File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
Microsoft.Toolkit.Uwp.UI.Controls/InAppNotification Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -80,16 +80,6 @@ protected override void OnApplyTemplate()
80
80
/// <param name="duration">Displayed duration of the notification in ms (less or equal 0 means infinite duration)</param>
81
81
public void Show ( int duration = 0 )
82
82
{
83
- _dismissTimer . Stop ( ) ;
84
-
85
- var eventArgs = new InAppNotificationOpeningEventArgs ( ) ;
86
- Opening ? . Invoke ( this , eventArgs ) ;
87
-
88
- if ( eventArgs . Cancel )
89
- {
90
- return ;
91
- }
92
-
93
83
// We keep our current content
94
84
var notificationOptions = new NotificationOptions
95
85
{
@@ -258,6 +248,14 @@ private void UpdateContent(NotificationOptions notificationOptions)
258
248
/// <param name="notificationOptions">Information about the notification to display</param>
259
249
private void Show ( NotificationOptions notificationOptions )
260
250
{
251
+ var eventArgs = new InAppNotificationOpeningEventArgs ( ) ;
252
+ Opening ? . Invoke ( this , eventArgs ) ;
253
+
254
+ if ( eventArgs . Cancel )
255
+ {
256
+ return ;
257
+ }
258
+
261
259
var shouldDisplayImmediately = true ;
262
260
switch ( StackMode )
263
261
{
@@ -288,6 +286,10 @@ private void Show(NotificationOptions notificationOptions)
288
286
_dismissTimer . Interval = TimeSpan . FromMilliseconds ( notificationOptions . Duration ) ;
289
287
_dismissTimer . Start ( ) ;
290
288
}
289
+ else
290
+ {
291
+ _dismissTimer . Stop ( ) ;
292
+ }
291
293
}
292
294
}
293
295
}
You can’t perform that action at this time.
0 commit comments