From fb801af73061ee5aeea8ccbb65e7264e26860c50 Mon Sep 17 00:00:00 2001 From: Tamer Date: Sat, 8 Sep 2018 18:01:10 -0700 Subject: [PATCH] Trying to address https://github.com/Federerer/Notifications.Wpf/issues/3 by introducing a work-around / quick fix until the cause of the problem is identified. --- Notifications.Wpf/Controls/Notification.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Notifications.Wpf/Controls/Notification.cs b/Notifications.Wpf/Controls/Notification.cs index 58ab8aa..3e8ebae 100644 --- a/Notifications.Wpf/Controls/Notification.cs +++ b/Notifications.Wpf/Controls/Notification.cs @@ -105,9 +105,16 @@ public async void Close() IsClosing = true; - RaiseEvent(new RoutedEventArgs(NotificationCloseInvokedEvent)); - await Task.Delay(_closingAnimationTime); - RaiseEvent(new RoutedEventArgs(NotificationClosedEvent)); + try + { + RaiseEvent(new RoutedEventArgs(NotificationCloseInvokedEvent)); + await Task.Delay(_closingAnimationTime); + RaiseEvent(new RoutedEventArgs(NotificationClosedEvent)); + } + catch (Exception) + { + // Fail silently (already closing) + } } } }