public HelloWorldViewModel() { this.DisplayMessageCommand = new RelayCommand(this.DisplayMessage, CanDisplayMessage); // Create a timer to go off once a minute to call RaiseCanExecuteChanged _timer = new DispatchTimer(); _timer = dispatcherTimer.Tick += OnTimerTick; _timer.Interval = new Timespan(0, 1, 0); _timer.Start(); }
public void SetSource(Uri path) { timerSliderIsDragged = false; mediaDisplay.Source = path; mediaDisplay.Play(); DispatchTimer.Start(); IsPaused = false; string uriToString = path.ToString().Remove(0, 8); ShellFile shellFile = ShellFile.FromFilePath(uriToString); var inputFile = new MediaFile { Filename = @uriToString }; using (var engine = new Engine()) { engine.GetMetadata(inputFile); } FrameRate = (inputFile.Metadata.VideoData.Fps); prevVolume = mediaDisplay.Volume; }
void Countdown(int count, TimeSpan interval, Action <int> ts) { this._dt.Stop(); this._dt = new System.Windows.Threading.DispatcherTimer(); this._dt.Interval = interval; this._dt.Tick += (_, a) => { if (count-- == 0) { MessageBox.Show("You have won this product!"); this._dt.Stop(); } else { ts(count); } }; ts(count); this._dt.Start(); }
public void AddDTTimerNoUpdate(DispatchTimer dt) { lstDTTimers.Add(dt); // UpdateMinDeltaTime(); }
public void RemoveDTTimer(DispatchTimer dt) { // NeedUpdateMinTimeDelta = true; lstDTTimers.Remove(dt); // UpdateMinDeltaTime(); }