Esempio n. 1
0
        private void DisplayNotification(NotificationManager.Notification notification)
        {
            if (!CheckAccess())
            {
                Dispatcher.Invoke(((Action) (() => DisplayNotification(notification))));
                return;
            }

            ImageSource = string.IsNullOrEmpty(notification.ImageName) ? null : Icons.GetAppIcon(notification.ImageName);
            DataContext = new AugmentedBindable<NotificationManager.Notification>(notification);
            Visibility = Visibility.Visible;
        }
Esempio n. 2
0
        public object Convert(object value, Type target_type, object parameter, CultureInfo culture)
        {
            //  use the Notification rather than the notification type, since need a ref object
            NotificationManager.Notification notification = value as NotificationManager.Notification;
            if (notification == null)
            {
                return(DependencyProperty.UnsetValue);
            }
            switch (notification.Type)
            {
            case NotificationManager.NotificationType.Info:
                return("#b5cbe8");

            case NotificationManager.NotificationType.Warning:
                return("#fae793");

            case NotificationManager.NotificationType.Error:
                return("#fe4242");

            default:
                throw new NotImplementedException();
            }
        }
Esempio n. 3
0
 /// <summary>
 /// The NotificationManager is responsible for telling us when to update our notification.
 /// </summary>
 private void Instance_NewNotificationFired(NotificationManager.Notification notification)
 {
     DisplayNotification(notification);
 }