private void NotificationItem_JustInTimeNotificationClosed(object sender, EventArgs e)
        {
            NotificationItem notification = (NotificationItem)sender;

            NotificationClosed?.Invoke(notification, EventArgs.Empty);
            Children.Remove(notification);
        }
        public void AddNotification(NotificationModel notification)
        {
            NotificationItem notificationItem = new NotificationItem(notification);

            Notifications.Add(notificationItem);

            _notificationsStackPanel.Children.Insert(0, notificationItem);
        }
        public void AddNotification(NotificationModel notification)
        {
            NotificationItem notificationItem = new NotificationItem(notification, true);

            notificationItem.JustInTimeNotificationClosed  += NotificationItem_JustInTimeNotificationClosed;
            notificationItem.JustInTimeNotificationElapsed += NotificationItem_JustInTimeNotificationElapsed;

            Children.Add(notificationItem);
        }
 private void NotificationItem_JustInTimeNotificationElapsed(object sender, EventArgs e)
 {
     this.Dispatcher.Invoke(delegate()
     {
         NotificationItem notification = (NotificationItem)sender;
         Children.Remove(notification);
         if (!notification.Notification.Ghost)
         {
             NotificationElapsed?.Invoke(this, EventArgs.Empty);
         }
     });
 }