private async void MediaPlayer_StateChanged(object sender, Template10.Common.ChangedEventArgs <MediaPlayerState> e) { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { if (e.NewValue == MediaPlayerState.Playing || e.NewValue == MediaPlayerState.Buffering) { VisualStateManager.GoToState(this, "Playing", true); IsDownloadBarDisabled = true; songtimer.Start(); } else { VisualStateManager.GoToState(this, "Paused", true); if (e.NewValue != MediaPlayerState.Opening) { songtimer.Stop(); } } }); }
private async void PlaybackSource_CurrentPlayingChanged(object sender, Template10.Common.ChangedEventArgs <SongModel> e) { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => CurrentSong = e.NewValue ?? SongModel.Null); }
private void Instance_PlaybackSourceChanged(object sender, Template10.Common.ChangedEventArgs <IPlaylist> e) { e.OldValue.CurrentPlayingChanged -= PlaybackSource_CurrentPlayingChanged; e.NewValue.CurrentPlayingChanged += PlaybackSource_CurrentPlayingChanged; this.IsPlayingRadio = (sender as PlaybackService).IsPlayingRadio; }