/// <summary> /// 确定按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click_1(object sender, RoutedEventArgs e) { MusicList newMusicList = new MusicList(); newMusicList = Data.MusicLists[0].Clone() as MusicList; newMusicList.Name = TextBox.Text; newMusicList.Time = DateTime.Now.ToString(); Data.MusicListName.Add(new ListName(TextBox.Text)); Data.MusicLists.Add(newMusicList); Data.SaveName(); Data.SaveData(); this.Close(); }
/// <summary> /// 初始化相关 /// </summary> public void Init() { //得到需要显示的页面名字 Data.selectName = (ParentWindow.MusicListListView.SelectedItem as ListName)?.Name; //查找到被选中的歌单 selectList = Data.FindElectMusicList(); //设置页面信息 selectList.SetName(ListName); selectList.SetAuthor(Creator); selectList.SetTime(CreatTime); selectList.SetTag(Mark); selectList.SetBrief(Brief); //不能工作,待解决 /* selectList.SetCoverUrl(CoverImage); * selectList.SetCoverUrl(BackImage); * selectList.SetCoverUrl(CreatorImage);*/ selectList.AddMusic(MusicListView); }
/// <summary> /// 添加歌单信息 /// </summary> /// <param name="item"></param> public void AddMusicList(MusicList item) { Data.MusicLists.Add(item); Data.SaveData();//保存一下数据 }