public SimpleNotification(NotificationOptions options, SimpleNotificationType type)
            : base(options)
        {
            InitializeComponent();

            switch (type)
            {
            case SimpleNotificationType.Info:
                Icon.Kind       = PackIconMaterialKind.InformationOutline;
                Icon.Foreground = Brushes.White;
                break;

            case SimpleNotificationType.Warn:
                Icon.Kind       = PackIconMaterialKind.AlertOutline;
                Icon.Foreground = Brushes.Yellow;
                break;

            case SimpleNotificationType.Error:
                Icon.Kind       = PackIconMaterialKind.CloseCircleOutline;
                Icon.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ff3030"));
                break;
            }

            this.PreviewKeyDown += HandleEsc;
        }
Example #2
0
 /// <inheritdoc />
 public SimpleNotification(string text,
                           SimpleNotificationType type = SimpleNotificationType.Done,
                           Action <SimpleNotification> selectedCallback = null,
                           Action <SimpleNotification> closedCallback   = null)
 {
     Type             = type;
     Text             = text;
     SelectedCallback = selectedCallback;
     ClosedCallback   = closedCallback;
     CloseCommand     = new ActionCommand(CloseExecute);
     SelectCommand    = new ActionCommand(SelectExecute);
 }