private void RemoveTrackItem_OnClick(object sender, RoutedEventArgs e) { var item = (Song)CurrentPlayingListView.SelectedItem; var index = CurrentSongs.FindIndex(x => x.Name.Equals(item.Name)); player.RemoveTrack(index); CurrentSongs.RemoveAt(index); //CurrentSongs.Remove(item); ReloadCurrentPlayingListViewItemsSource(); }
private void AddTrackToPlaylistItem_OnClick(object sender, RoutedEventArgs e) { var song = sender.ToString(); AddTrackToPlaylistWindow dialog = new AddTrackToPlaylistWindow(PlaylistsToString); if (dialog.ShowDialog() == true) { var item = (Song)CurrentPlayingListView.SelectedItem; var index = CurrentSongs.FindIndex(x => x.Name.Equals(item.Name)); var playlistName = dialog.SelectedPlaylistName; player.AddTrackToPlaylist(index, playlistName); ReloadPlaylistsListViewItemsSource(); ReloadCurrentPlayingListViewItemsSource(); } }