Exemplo n.º 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();
        }
Exemplo n.º 2
0
 private async void ContentDialog_AddNewPlaylist_Closed(ContentDialog sender, ContentDialogClosedEventArgs args)
 {
     ContentDialog_AddNewPlaylist.Closed -= ContentDialog_AddNewPlaylist_Closed;
     await ContentDialog_CreatedPlaylist.ShowAsync();
 }