Пример #1
0
        private void NotificationItem_JustInTimeNotificationClosed(object sender, EventArgs e)
        {
            NotificationItem notification = (NotificationItem)sender;

            NotificationClosed?.Invoke(notification, EventArgs.Empty);
            Children.Remove(notification);
        }
Пример #2
0
        public void AddNotification(NotificationModel notification)
        {
            NotificationItem notificationItem = new NotificationItem(notification);

            Notifications.Add(notificationItem);

            _notificationsStackPanel.Children.Insert(0, notificationItem);
        }
Пример #3
0
        public void AddNotification(NotificationModel notification)
        {
            NotificationItem notificationItem = new NotificationItem(notification, true);

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

            Children.Add(notificationItem);
        }
Пример #4
0
 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);
         }
     });
 }