Skip to content

Commit

Permalink
fix: Allow closing ContentDIalog after button click cancellation
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Oct 29, 2024
1 parent 3f1dca2 commit 2aacc68
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Uno.UI/UI/Xaml/Controls/ContentDialog/ContentDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ public void Hide()
{
return;
}
_hiding = true;
Hide(ContentDialogResult.None);
}

internal bool Hide(ContentDialogResult result)
{
_hiding = true;
void Complete(ContentDialogClosingEventArgs args)
{
if (!args.Cancel)
Expand Down Expand Up @@ -476,7 +476,6 @@ void Complete(ContentDialogButtonClickEventArgs a)
{
return;
}
_hiding = true;

var args = new ContentDialogButtonClickEventArgs(Complete);
CloseButtonClick?.Invoke(this, args);
Expand Down Expand Up @@ -507,7 +506,6 @@ void Complete(ContentDialogButtonClickEventArgs a)
{
return;
}
_hiding = true;

var args = new ContentDialogButtonClickEventArgs(Complete);
SecondaryButtonClick?.Invoke(this, args);
Expand Down Expand Up @@ -540,7 +538,6 @@ void Complete(ContentDialogButtonClickEventArgs a)
{
return;
}
_hiding = true;

var args = new ContentDialogButtonClickEventArgs(Complete);
PrimaryButtonClick?.Invoke(this, args);
Expand Down

0 comments on commit 2aacc68

Please sign in to comment.