private void Timer_TimingStopped(ViewModels.TimerViewModel sender, ViewModels.TimingStoppedViewModel args) { if (!args.IsSuccessful && !string.IsNullOrWhiteSpace(args.CompletionMessage)) { Dispatcher.InvokeAsync(() => { MessageBox.Show(args.CompletionMessage); if (NavigationService.CanGoBack) { NavigationService.GoBack(); } }); } }
private void ViewModel_TimingStarted(ViewModels.TimerViewModel sender, object args) { FrameworkDispatcher.Update(); if (!MediaPlayer.GameHasControl) { App.ViewModel.NeedToResumeMusic = true; MediaPlayer.Pause(); } Dispatcher.BeginInvoke(async() => { metTimingStarted.Play(); var currentBackground = LayoutRoot.Background; LayoutRoot.Background = this.Resources[AppConstants.RESOURCE_BRUSH_PHONECONTRASTBACKGROUND] as Brush; await Task.Delay(1000); LayoutRoot.Background = currentBackground; }); }