Beispiel #1
0
        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();
                    }
                });
            }
        }
Beispiel #2
0
        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;
            });
        }