Skip to content

Commit fd09c00

Browse files
authored
Merge branch 'master' into feature/generic-throw-helper
2 parents 71d9165 + 3105e39 commit fd09c00

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ private void DismissTimer_Tick(object sender, object e)
4343
Dismiss(InAppNotificationDismissKind.Timeout);
4444
}
4545

46+
private void OnCurrentStateChanging(object sender, VisualStateChangedEventArgs e)
47+
{
48+
if (e.NewState.Name == StateContentVisible)
49+
{
50+
Visibility = Visibility.Visible;
51+
}
52+
}
53+
4654
private void OnCurrentStateChanged(object sender, VisualStateChangedEventArgs e)
4755
{
4856
switch (e.NewState.Name)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ protected override void OnApplyTemplate()
5151

5252
if (_visualStateGroup != null)
5353
{
54+
_visualStateGroup.CurrentStateChanging -= OnCurrentStateChanging;
5455
_visualStateGroup.CurrentStateChanged -= OnCurrentStateChanged;
5556
}
5657

@@ -67,6 +68,7 @@ protected override void OnApplyTemplate()
6768

6869
if (_visualStateGroup != null)
6970
{
71+
_visualStateGroup.CurrentStateChanging += OnCurrentStateChanging;
7072
_visualStateGroup.CurrentStateChanged += OnCurrentStateChanged;
7173
}
7274

0 commit comments

Comments
 (0)