// 批量删除选中的歌曲 public void DeleteSelectedSongs() { ObservableCollection <Song> songsInList = SongsInList[ClickedListName]; foreach (Song song in SelectedSongs) { SongsInClickedList.Remove(song); songsInList.Remove(song); DBManager.DeleteSong(ClickedListName, song); } UpdateNumberInList(ClickedListName); SelectedSongs.Clear(); }
// 用户点击一个歌单后,设置展示数据源 public void SetClickedList(string name) { SongsInClickedList.Clear(); foreach (Song song in SongsInList[name]) { SongsInClickedList.Add(song); } if (ClickedListName != name) { ClickedListName = name; isClickedListChanged = true; } }