private void Player_PlayingStopped(object sender, PlayingStoppedEventArgs args)
 {
     if(args.PlayedToEnd) {
         var curIndex = TrackList.CurrentSongIndex;
         TrackList.CurrentSongIndex = TrackList.HasNext ? (curIndex + 1) : (Loop ? (0) : (curIndex));
         Player.PlayerState = PlayerState.Paused;
         Task.Delay((int)SongDelayMs).ContinueWith((t) => {
             Player.PlayerState = PlayerState.Playing;
         });
     }
 }
Ejemplo n.º 2
0
 private void Player_PlaybackStopped(object sender, StoppedEventArgs e)
 {
     PlayingStoppedEventArgs stoppedEventArgs = null;
     if(e.Exception == null) {
         PlayedToEnd = true;
         stoppedEventArgs = new PlayingStoppedEventArgs(true);
     } else {
         stoppedEventArgs = new PlayingStoppedEventArgs(false, e.Exception);
     }
     PlayingStopped?.Invoke(this, stoppedEventArgs);
 }
 protected void Player_PlayingStopped(object sender, PlayingStoppedEventArgs args)
 {
     RaisePropertiesChanged(nameof(SwitchButtonImgSource), nameof(EnableChangeElapsed));
 }