public void ChangeMusicTrack(MusicTrack music, bool shouldPlay = false) { if (music == null) { return; } MusicPlayer.Open(new Uri(music.Path)); MainWindow.albumArtPlace.Source = GetImageFromAlbumArtProperty(music.Path); MainWindow.currentSongPlaying.Text = music.AlbumTitle; if (shouldPlay) { MusicPlayer.Play(); IsPlaying = true; OnPlaySwitch.Invoke(this, IsPlaying); } }
/// <summary> /// Switch between Pause and Play. /// </summary> public void SwitchPlayPause() { IsPlaying = MusicPlayer.PlayWithPause(IsPlaying); OnPlaySwitch.Invoke(this, IsPlaying); }