コード例 #1
0
 public static void ShowNotification(string text, InfoType type)
 {
     NotificationWindow.Dispatcher.BeginInvoke(new Action(() => {
         var brush = Brushes[type];
         var icon  = Icons[type];
         NotificationWindow.Notify(text, false, brush, icon);
     }));
 }
コード例 #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var color = Colors.Red;
            var sec   = DateTime.Now.Second;

            if (sec % 2 == 0)
            {
                color = Colors.Blue;
            }
            else if (sec % 3 == 0)
            {
                color = Colors.Black;
            }
            else if (sec % 5 == 0)
            {
                color = Colors.BlueViolet;
            }
            _tv.Notify(tb.Text, false, new SolidColorBrush(color));
            //_notify.SetValue(null, tb.Text);
        }