コード例 #1
0
        private async void Button_AddToPlaylist_Click(object sender, RoutedEventArgs e)
        {
            if (!PlayingService.IsPlayingSong)
            {
                return;
            }
            if (PlayingService.PlaylistItems_Created == null && PlayingService.PlaylistItems_Subscribed == null)
            {
                PlayingService.PlaylistItems_Created    = new ObservableCollection <PlaylistItem>();
                PlayingService.PlaylistItems_Subscribed = new ObservableCollection <PlaylistItem>();
                MyPlaylistRoot myPlaylistRoot = await Task.Run(() => PlaylistService.GetMyPlaylist());

                foreach (var temp in myPlaylistRoot.playlist)
                {
                    if (temp.subscribed == "true")
                    {
                        PlayingService.PlaylistItems_Subscribed.Add(temp);
                    }
                    else
                    {
                        PlayingService.PlaylistItems_Created.Add(temp);
                    }
                }
                myPlaylistRoot = null;
            }
            ListBox_CreatedPlaylist.ItemsSource = PlayingService.PlaylistItems_Created;
            await ContentDialog_CreatedPlaylist.ShowAsync();
        }
コード例 #2
0
        private void ListBox_CreatedPlaylist_Tapped(object sender, TappedRoutedEventArgs e)
        {
            var playlist = ((ListBox)sender).SelectedItem as PlaylistItem;

            if (PlaylistService.AddToPlaylist(playlist.id, _songsItem.Id))
            {
                NotifyPopup notifyPopup = new NotifyPopup("已添加到歌单", "\xF78C", Colors.MediumSeaGreen);
                notifyPopup.Show();
                playlist.coverImgUrl = _albumRoot.album.picUrl;
                ContentDialog_CreatedPlaylist.Hide();
            }
            else
            {
                NotifyPopup notifyPopup = new NotifyPopup("添加失败", "\xF78A");
                notifyPopup.Show();
            }
        }
コード例 #3
0
 private async void ContentDialog_AddNewPlaylist_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     ContentDialog_AddNewPlaylist.Closed -= ContentDialog_AddNewPlaylist_Closed;
     await ContentDialog_CreatedPlaylist.ShowAsync();
 }
コード例 #4
0
 private void Button_AddNewPlaylist_Click(object sender, RoutedEventArgs e)
 {
     ContentDialog_CreatedPlaylist.Closed += ContentDialog_CreatedPlaylist_Closed;
     ContentDialog_CreatedPlaylist.Hide();
 }
コード例 #5
0
 private void Button_CloseAddToPlaylistDialog_Click(object sender, RoutedEventArgs e)
 {
     ContentDialog_CreatedPlaylist.Hide();
 }