Skip to content

Commit

Permalink
fix: #131 add dialog to panel even if IsOpen already set to true
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Nov 5, 2022
1 parent 98278c6 commit 429d1d4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<AutoGenerateBindingRedirects Condition=" $(TargetFramework.StartsWith('net4')) ">true</AutoGenerateBindingRedirects>
<LangVersion>8.0</LangVersion>
<LangVersion>9</LangVersion>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<NoWarn>$(NoWarn);CS1591</NoWarn>
Expand Down
6 changes: 4 additions & 2 deletions src/MahApps.Metro.SimpleChildWindow/ChildWindowManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,11 @@ public static async Task<TResult> ShowChildWindowAsync<TResult>(this Control con

private static async Task<TResult> OpenDialogAsync<TResult>(ChildWindow dialog, Panel container, TaskCompletionSource<TResult> tcs)
{
if (!dialog.IsOpen)
var hasParent = dialog.TryFindParent<Panel>() is not null;

if (!dialog.IsOpen || !hasParent)
{
if (dialog.TryFindParent<Panel>() is null)
if (!hasParent)
{
container.Children.Add(dialog);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
</ItemGroup>

<ItemGroup>
<Compile DependentUpon="%(Filename)"
SubType="Code"
Update="**\obj\**\*.g$(DefaultLanguageSourceExtension)" />
<Compile DependentUpon="%(Filename)"
SubType="Designer"
Update="**\*.xaml$(DefaultLanguageSourceExtension)" />
<Compile DependentUpon="%(Filename)" SubType="Code" Update="**\obj\**\*.g$(DefaultLanguageSourceExtension)" />
<Compile DependentUpon="%(Filename)" SubType="Designer" Update="**\*.xaml$(DefaultLanguageSourceExtension)" />
</ItemGroup>
</Project>

0 comments on commit 429d1d4

Please sign in to comment.