diff --git a/src/TheXamlGuy.NotificationFlyout.Uwp.UI.Controls/NotificationFlyout/NotificationFlyout.cs b/src/TheXamlGuy.NotificationFlyout.Uwp.UI.Controls/NotificationFlyout/NotificationFlyout.cs index 841ae1f..40f9bbb 100644 --- a/src/TheXamlGuy.NotificationFlyout.Uwp.UI.Controls/NotificationFlyout/NotificationFlyout.cs +++ b/src/TheXamlGuy.NotificationFlyout.Uwp.UI.Controls/NotificationFlyout/NotificationFlyout.cs @@ -30,9 +30,7 @@ namespace TheXamlGuy.NotificationFlyout.Uwp.UI.Controls public NotificationFlyout() => DefaultStyleKey = typeof(NotificationFlyout); public event EventHandler Closed; - public event TypedEventHandler Closing; public event EventHandler Opened; - public event EventHandler Opening; internal event EventHandler IconSourceChanged; @@ -139,16 +137,12 @@ namespace TheXamlGuy.NotificationFlyout.Uwp.UI.Controls sender?.OnIconPropertyChanged(); } - private void InvokeClosedEvent(object obj) => Closed?.Invoke(this, obj); - - private void InvokeClosingEvent(NotificationFlyoutClosingEventArgs eventArgs) => Closing?.Invoke(this, eventArgs); - - private void InvokeOpenedEvent(object obj) => Opened?.Invoke(this, obj); - - private void InvokeOpeningEvent(object obj) => Opening?.Invoke(this, obj); - private void OnIconPropertyChanged() => IconSourceChanged?.Invoke(this, EventArgs.Empty); + private void OnPopupClosed(object sender, object args) => Opened?.Invoke(this, args); + + private void OnPopupOpened(object sender, object args) => Closed?.Invoke(this, args); + private void PreparePopup() { _popup = new Popup @@ -159,6 +153,9 @@ namespace TheXamlGuy.NotificationFlyout.Uwp.UI.Controls HorizontalOffset = -1, VerticalOffset = -1 }; + + _popup.Opened += OnPopupOpened; + _popup.Closed += OnPopupClosed; } } } \ No newline at end of file diff --git a/src/TheXamlGuy.NotificationFlyout.Uwp.UI.Controls/NotificationFlyout/NotificationFlyoutClosingEventArgs.cs b/src/TheXamlGuy.NotificationFlyout.Uwp.UI.Controls/NotificationFlyout/NotificationFlyoutClosingEventArgs.cs deleted file mode 100644 index 24f8a18..0000000 --- a/src/TheXamlGuy.NotificationFlyout.Uwp.UI.Controls/NotificationFlyout/NotificationFlyoutClosingEventArgs.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace TheXamlGuy.NotificationFlyout.Uwp.UI.Controls -{ - public sealed class NotificationFlyoutClosingEventArgs : EventArgs - { - public bool Cancel { get; set; } - } -} \ No newline at end of file