Skip to content

Commit

Permalink
fix: changed order of calls in ContentDialog Hide complete handler to…
Browse files Browse the repository at this point in the history
… invoke the closed handler before the result is set, and modified UI test to change the text before deferral is completed.
  • Loading branch information
zangai committed Nov 2, 2020
1 parent ced3508 commit 88e62ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ private void DeferredDialog_Click(object sender, RoutedEventArgs args)
var defer1Button = new _Button { Name = "Complete1Button", Content = "Complete 1" };
defer1Button.Click += (o, e) =>
{
deferral1.Complete();
ResultTextBlock.Text = "First complete called";
deferral1.Complete();
};
var defer2Button = new _Button { Name = "Complete2Button", Content = "Complete 2" };
defer2Button.Click += (o, e) =>
{
deferral2.Complete();
ResultTextBlock.Text = "Second complete called";
deferral2.Complete();
};
var panel = new StackPanel
{
Expand Down
3 changes: 1 addition & 2 deletions src/Uno.UI/UI/Xaml/Controls/ContentDialog/ContentDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,8 @@ void Complete(ContentDialogClosingEventArgs args)
_popup.IsOpen = false;
_popup.Child = null;
UpdateVisualState();
_tcs.SetResult(result);

Closed?.Invoke(this, new ContentDialogClosedEventArgs(result));
_tcs.SetResult(result);
}
}
var closingArgs = new ContentDialogClosingEventArgs(Complete, result);
Expand Down

0 comments on commit 88e62ff

Please sign in to comment.