Skip to content

Commit fbf48d6

Browse files
committed
Fixed an issue where InAppNotification couldn't be dismissing programatically after canceling the closing event.
1 parent 5327002 commit fbf48d6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Core/InAppNotification/InAppNotification.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,14 @@ private void Dismiss(InAppNotificationDismissKind dismissKind, bool dismissAll =
184184
return;
185185
}
186186

187+
var closingEventArgs = new InAppNotificationClosingEventArgs(dismissKind);
188+
Closing?.Invoke(this, closingEventArgs);
189+
190+
if (closingEventArgs.Cancel)
191+
{
192+
return;
193+
}
194+
187195
_dismissTimer.Stop();
188196

189197
// Dismiss all if requested
@@ -212,14 +220,6 @@ private void Dismiss(InAppNotificationDismissKind dismissKind, bool dismissAll =
212220
return;
213221
}
214222

215-
var closingEventArgs = new InAppNotificationClosingEventArgs(dismissKind);
216-
Closing?.Invoke(this, closingEventArgs);
217-
218-
if (closingEventArgs.Cancel)
219-
{
220-
return;
221-
}
222-
223223
var result = VisualStateManager.GoToState(this, StateContentCollapsed, true);
224224
if (!result)
225225
{

0 commit comments

Comments
 (0)