private void MediaPlayer_CurrentStateChanged(object sender, RoutedEventArgs e) { switch (mediaPlayer.CurrentState) { case MediaElementState.Playing: _systemMediaTransportControls.PlaybackStatus = MediaPlaybackStatus.Playing; PlayButtonView.Symbol = Symbol.Pause; StoryboardR.Resume(); break; case MediaElementState.Paused: if (index != -1) { index = -1; break; } _systemMediaTransportControls.PlaybackStatus = MediaPlaybackStatus.Paused; PlayButtonView.Symbol = Symbol.Play; StoryboardR.Pause(); break; case MediaElementState.Stopped: _systemMediaTransportControls.PlaybackStatus = MediaPlaybackStatus.Stopped; PlayButtonView.Symbol = Symbol.Play; StoryboardR.Stop(); break; case MediaElementState.Closed: _systemMediaTransportControls.PlaybackStatus = MediaPlaybackStatus.Closed; break; default: break; } }
private void SwitchMode_Click(object sender, RoutedEventArgs e) { if (SwitchIcon.Symbol == Symbol.Rotate) { SwitchIcon.Symbol = Symbol.DisableUpdates; CoverHolder.Visibility = Visibility.Collapsed; RotateImage.Visibility = Visibility.Visible; StoryboardR.Begin(); } else { SwitchIcon.Symbol = Symbol.Rotate; CoverHolder.Visibility = Visibility.Visible; RotateImage.Visibility = Visibility.Collapsed; } }