public ShutdownWarningWindowViewModel(EncodeCompleteActionType actionType) { this.actionType = actionType; this.timer = new DispatcherTimer(); this.timer.Interval = TimeSpan.FromSeconds(1); this.timer.Tick += (o, e) => { secondsRemaining--; this.RaisePropertyChanged(nameof(this.Message)); if (secondsRemaining == 0) { this.timer.Stop(); this.Cancel.Execute(null); this.ExecuteAction(); } }; this.timer.Start(); }
public ShutdownWarningViewModel(EncodeCompleteActionType actionType) { this.actionType = actionType; this.timer = new DispatcherTimer(); this.timer.Interval = TimeSpan.FromSeconds(1); this.timer.Tick += (o, e) => { secondsRemaining--; this.RaisePropertyChanged(() => this.Message); if (secondsRemaining == 0) { this.timer.Stop(); this.CancelCommand.Execute(null); this.ExecuteAction(); } }; this.timer.Start(); }