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; }
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["Стоп"] }; }
public void RemoveNotification(NotificationDisplayPart notification) { Items.Remove(notification); }
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(); }
public NotificationAnimator(NotificationDisplayPart displayPart, TimeSpan showAnimationTime, TimeSpan hideAnimationTime) { _displayPart = displayPart; _showAnimationTime = showAnimationTime; _hideAnimationTime = hideAnimationTime; }