Skip to content

Commit

Permalink
#585 Use different approach in Window Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigel Sampson committed Apr 8, 2019
1 parent 1416e4a commit 7d2cd98
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/Caliburn.Micro.Platform/Platforms/net46/WindowManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,23 +408,22 @@ private async void Closing(object sender, CancelEventArgs e)

e.Cancel = true;

await Task.Yield();

var canClose = await guard.CanCloseAsync(CancellationToken.None);

if (!canClose)
return;

if (canClose)
{
actuallyClosing = true;
actuallyClosing = true;

if (view.DialogResult != cachedDialogResult)
{
view.DialogResult = cachedDialogResult;
view.Close();
}
else
{
e.Cancel = false;
}


if (cachedDialogResult == null)
{
view.Close();
}
else if (view.DialogResult != cachedDialogResult)
{
view.DialogResult = cachedDialogResult;
}
}
}
Expand Down

0 comments on commit 7d2cd98

Please sign in to comment.