Amend how we hide via deactivation as the user may still want to call Hide explicitly while having IsLightDismissedEnabled set to false
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
x:Class="NotificationFlyoutSample.SampleFlyout"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:TheXamlGuy.NotificationFlyout.Uwp.UI.Controls">
|
||||
xmlns:controls="using:TheXamlGuy.NotificationFlyout.Uwp.UI.Controls"
|
||||
IsLightDismissEnabled="False">
|
||||
<controls:NotificationFlyout.ContextFlyout>
|
||||
<MenuFlyout>
|
||||
<MenuFlyoutItem Click="OnCloseMenuFlyoutItemClick" Text="Close" />
|
||||
|
||||
+6
-1
@@ -69,9 +69,14 @@ namespace TheXamlGuy.NotificationFlyout.Uwp.UI.Controls
|
||||
PreparePopup();
|
||||
}
|
||||
|
||||
_popup.IsOpen = false;
|
||||
}
|
||||
|
||||
internal void TryHide()
|
||||
{
|
||||
if (IsLightDismissEnabled)
|
||||
{
|
||||
_popup.IsOpen = false;
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ namespace TheXamlGuy.NotificationFlyout.Wpf.UI.Controls
|
||||
private void OnNotificationFlyoutXamlHostDeactivated(object sender, EventArgs args)
|
||||
{
|
||||
if (Flyout == null) return;
|
||||
Flyout.Hide();
|
||||
Flyout.TryHide();
|
||||
}
|
||||
|
||||
private void ShowFlyout()
|
||||
|
||||
Reference in New Issue
Block a user