public mySongList() { this.InitializeComponent(); mySongListVM = MySongListVM.GetMySongListVM(); mySongListVM.SongsInClickedList.Clear(); }
// 编辑/取消/添加 按钮点击事件 private async void AddSongsToListBtn_Click(object sender, RoutedEventArgs e) { // 编辑 if (AddSongsToListBtn.Content.ToString() == EDIT) { AddSongsToListBtn.Content = CANCEL; SongListLV.SelectionMode = ListViewSelectionMode.Multiple; SongListLV.IsItemClickEnabled = false; isSelecting = true; } // 取消 else if (AddSongsToListBtn.Content.ToString() == CANCEL) { AddSongsToListBtn.Content = EDIT; SongListLV.SelectionMode = ListViewSelectionMode.Single; SongListLV.IsItemClickEnabled = true; } // 添加 else if (AddSongsToListBtn.Content.ToString() == ADD) { MySongListVM.GetMySongListVM().SongsToBeAddedToList = localSongsVM.SelectedSongs; // 弹出歌单选择对话框 await new SelectSongListDialog().ShowAsync(); AddSongsToListBtn.Content = EDIT; SongListLV.SelectionMode = ListViewSelectionMode.Single; SongListLV.IsItemClickEnabled = true; } }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { string listName = SongListName.Text.ToString(); // 更新MySongListVM中的数据 MySongListVM.GetMySongListVM().CreateSongList(listName); }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { MySongListVM.GetMySongListVM().AddSongsToList(((SongList)MySongListsLV.SelectedItem).Name); }
public SelectSongListDialog() { this.InitializeComponent(); MySongLists = MySongListVM.GetMySongListVM().SongLists; }