private async void MoreSongBox_BtnClickedEvent(UserControlClass.SongMultipleBox.BtnType type)
        {
            LoadProcess.IsActive = true;
            switch (type)
            {
            case UserControlClass.SongMultipleBox.BtnType.NextPlay:
                foreach (var item in SongListView.SelectedItems)
                {
                    var music = item as SongLsitData.SongData;
                    await music.AddToPlayList(false);
                }
                await new MessageDialog("已添加到播放列表").ShowAsync();
                SongListView.SelectionMode = ListViewSelectionMode.Single;
                MoreSongBox.Hidden();
                MoreSongBox.BtnClickedEvent -= MoreSongBox_BtnClickedEvent;
                break;

            case UserControlClass.SongMultipleBox.BtnType.Download:
                foreach (var item in SongListView.SelectedItems)
                {
                    var music = item as SongLsitData.SongData;
                    await music.AddToDownloadList();
                }
                await new MessageDialog("已添加到下载列表").ShowAsync();
                SongListView.SelectionMode = ListViewSelectionMode.Single;
                MoreSongBox.Hidden();
                MoreSongBox.BtnClickedEvent -= MoreSongBox_BtnClickedEvent;
                break;

            case UserControlClass.SongMultipleBox.BtnType.AddToList:
                SongListView.SelectionMode = ListViewSelectionMode.Single;
                MoreSongBox.Hidden();
                MoreSongBox.BtnClickedEvent -= MoreSongBox_BtnClickedEvent;
                break;

            case UserControlClass.SongMultipleBox.BtnType.SelectAll:
                if (SongListView.SelectedItems.Count == 0)
                {
                    SongListView.SelectAll();
                }
                else
                {
                    SongListView.SelectedItems.Clear();
                }
                break;

            default:
                break;
            }
            LoadProcess.IsActive = false;
        }
Ejemplo n.º 2
0
        private async void MoreSongBox_BtnClickedEvent(UserControlClass.SongMultipleBox.BtnType type)
        {
            if (SongListView.SelectedItems != null)
            {
                SongLoadProgress.IsActive = true;
                switch (type)
                {
                case UserControlClass.SongMultipleBox.BtnType.NextPlay:
                    foreach (var item in SongListView.SelectedItems)
                    {
                        var song = item as SongData;
                        await song.AddToPlayList(false);
                    }
                    break;

                case UserControlClass.SongMultipleBox.BtnType.Download:
                    foreach (var item in SongListView.SelectedItems)
                    {
                        var song = item as SongData;
                        await song.AddToDownloadList();
                    }
                    break;

                case UserControlClass.SongMultipleBox.BtnType.AddToList:
                    break;

                case UserControlClass.SongMultipleBox.BtnType.SelectAll:
                    if (SongListView.SelectedItems.Count == 0)
                    {
                        SongListView.SelectAll();
                    }
                    else
                    {
                        SongListView.SelectedItems.Clear();
                    }
                    break;

                default:
                    break;
                }
                if (type != UserControlClass.SongMultipleBox.BtnType.SelectAll)
                {
                    MoreSongBox.Hidden();
                    SongListView.SelectionMode = ListViewSelectionMode.Single;
                }
                SongLoadProgress.IsActive = false;
            }
        }