Skip to content

Commit 64bd150

Browse files
committed
live region event will now also be sent when replacing the content
1 parent 9cac1b7 commit 64bd150

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ private void OnCurrentStateChanged(object sender, VisualStateChangedEventArgs e)
5959
private void OnNotificationVisible()
6060
{
6161
Opened?.Invoke(this, EventArgs.Empty);
62-
RaiseAutomationNotification();
6362
}
6463

6564
private void OnNotificationCollapsed()

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
using Microsoft.Toolkit.Uwp.Extensions;
6+
using Microsoft.Toolkit.Uwp.UI.Extensions;
57
using System;
68
using System.Collections.Generic;
79
using System.Linq;
8-
using Microsoft.Toolkit.Uwp.Extensions;
9-
using Microsoft.Toolkit.Uwp.UI.Extensions;
1010
using Windows.UI.Xaml;
1111
using Windows.UI.Xaml.Automation;
1212
using Windows.UI.Xaml.Controls;
@@ -246,6 +246,8 @@ private void UpdateContent(NotificationOptions notificationOptions)
246246
_contentProvider.Content = content;
247247
break;
248248
}
249+
250+
RaiseAutomationNotification();
249251
}
250252

251253
/// <summary>
@@ -282,11 +284,11 @@ private void Show(NotificationOptions notificationOptions)
282284

283285
if (shouldDisplayImmediately)
284286
{
285-
UpdateContent(notificationOptions);
286-
287287
Visibility = Visibility.Visible;
288288
VisualStateManager.GoToState(this, StateContentVisible, true);
289289

290+
UpdateContent(notificationOptions);
291+
290292
if (notificationOptions.Duration > 0)
291293
{
292294
_dismissTimer.Interval = TimeSpan.FromMilliseconds(notificationOptions.Duration);

0 commit comments

Comments
 (0)