Example #1
0
        public void AddToDefaultList()
        {
            if ("默认列表" == PlayerList.PreListTitle)
            {
                Toast.Show("添加失败!歌单相同!", Toast.InfoType.Error); return;
            }

            if (MusicInfos is null)
            {
                return;
            }
            //在默认列表数据库中加入音乐
            var dlm = new DefaultListManager();
            var mim = new MusicInfoManager();

            foreach (var item in MusicInfos)
            {
                dlm.Insert(new DefaultListModel(item.Id));
                mim.Insert(new MusicInfoModel(item));
            }

            //如果当前BasePage的DataGrid展示的是默认列表,进行刷新
            ViewModelManager.BasePageViewModel.RefreshShowList("默认列表");
            Toast.Show("添加成功!", Toast.InfoType.Success);
        }
Example #2
0
        public void AddToCustomList(object parameter)
        {
            if (parameter.ToString() == PlayerList.PreListTitle)
            {
                Toast.Show("添加失败!歌单相同!", Toast.InfoType.Error); return;
            }
            if (menuParameter is null)
            {
                return;
            }
            //将音乐加入到自定义列表数据库
            var orm = new CustomListManager();

            orm.Insert(new CustomListModel(parameter.ToString(), (menuParameter as IMusic).Id));
            var mim = new MusicInfoManager();

            mim.Insert(new MusicInfoModel(menuParameter as IMusic));
            ViewModelManager.BasePageViewModel.RefreshShowList(parameter.ToString());
            Toast.Show("添加成功!", Toast.InfoType.Success);
        }