public TimerNotificationModel(DateTime time) : base("", new MessageOptions())
        {
            _displayPart = new DynamicNotification(this);
            this.Title   = LocalizationContainer.Localization["До следующего занятия:"];
            this.Text    = (time - DateTime.Now).ToString(@"hh\:mm\:ss");
            var timer = Observable
                        .Interval(TimeSpan.FromMilliseconds(1000))
                        .ObserveOnDispatcher(DispatcherPriority.Background)
                        .Subscribe(l => this.Text = (time - DateTime.Now).ToString(@"hh\:mm\:ss"));

            _timer = timer;
        }
Ejemplo n.º 2
0
 public AudioPlayerNotificationModel(IWavePlayer audio) : base("", new MessageOptions())
 {
     this.DisplayPart       = (_displayPart = new AudioPlayerNotification(this));
     audio.PlaybackStopped += (sender, args) => Close();
     this.Title             = LocalizationContainer.Localization["Аудиофайл"];
     this.DoStop            = new ButtonConfig {
         Command = new CommandHandler(() => {
             audio.Stop();
             Close();
         }),
         Text = LocalizationContainer.Localization["Стоп"]
     };
 }
Ejemplo n.º 3
0
 public void RemoveNotification(NotificationDisplayPart notification)
 {
     Items.Remove(notification);
 }
Ejemplo n.º 4
0
 public void AddNotification(NotificationDisplayPart notification)
 {
     Items.Add(notification);
 }
 public void CloseNotification(NotificationDisplayPart notification)
 {
     NotificationsList.RemoveNotification(notification);
     RecomputeLayout();
 }
 public void ShowNotification(NotificationDisplayPart notification)
 {
     NotificationsList.AddNotification(notification);
     RecomputeLayout();
 }
Ejemplo n.º 7
0
 public NotificationAnimator(NotificationDisplayPart displayPart, TimeSpan showAnimationTime, TimeSpan hideAnimationTime)
 {
     _displayPart       = displayPart;
     _showAnimationTime = showAnimationTime;
     _hideAnimationTime = hideAnimationTime;
 }