Beispiel #1
0
        private void SlideOutCompleted(object sender, EventArgs e)
        {
            var handler = OnClose;
            var args    = new OnCloseEventArgs
            {
                notification = this
            };

            handler(sender, args);
        }
Beispiel #2
0
        private void OnCloseNotification(object sender, OnCloseEventArgs e)
        {
            if (e.notification == null)
            {
                return;
            }

            if (e.notification.Id != Guid.Empty && e.notification.Index > 0)
            {
                var notificationToClose = notifications.FirstOrDefault(n => n.Id == e.notification.Id);
                notifications.Remove(notificationToClose);

                e.notification.Close();

                var handler = OnCloseNotifications;
                var args    = new OnCloseNotificationsArgs
                {
                    Id      = e.notification.Id,
                    Title   = e.notification.Title,
                    Message = e.notification.Message,
                    Type    = e.notification.Type,
                    Answer  = e.notification.Type == NotificationType.Answer
                             ? e.notification.Answer
                             : e.notification.Type == NotificationType.YesNo
                                    ? e.notification.Yes
                                        ? "Yes"
                                        : "No"
                                    : ""
                };
                handler(sender, args);

                var qtdNotifications = notifications.Count;
                var workArea         = System.Windows.SystemParameters.WorkArea;
                foreach (var notif in notifications.OrderByDescending(n => n.Index))
                {
                    if (notif.Index > e.notification.Index)
                    {
                        notif.Index--;
                        notif.SlideMeDown(workArea.Bottom - ((notif.Height + 10) * notif.Index), 100 * notif.Index);
                    }
                }
            }
        }