public async Task <FeaturedPlaylistsResponse> GetFeaturedPLaylists() { FeaturedPlaylistsResponse playlists = null; HttpResponseMessage response = await client.GetAsync(URL + "/featured-playlists"); if (response.IsSuccessStatusCode) { playlists = JsonConvert.DeserializeObject <FeaturedPlaylistsResponse>(await response.Content.ReadAsStringAsync()); } return(playlists); }
public PlaylistsPage(FeaturedPlaylistsResponse featuredPlaylists) { InitializeComponent(); TitleBlock.Text = featuredPlaylists.Message; featuredPlaylists.Playlists.Items.ForEach(playlist => { var playlistCard = new PlaylistCardComponent(playlist.Name, playlist.Images[0].Url, playlist.Uri); Frame frame = new Frame(); frame.Navigate(playlistCard); Playlists.Children.Add(frame); }); }
/// <summary> /// The NavigateToPlaylistsPage /// </summary> /// <param name="sender">The sender <see cref="object" /></param> /// <param name="e">The e <see cref="RoutedEventArgs" /></param> private async void NavigateToPlaylistsPage(object sender, RoutedEventArgs e) { FeaturedPlaylistsResponse featuredPlaylists = await _spotify.GetFeaturedPLaylists(); CurrentPage.Content = new PlaylistsPage(featuredPlaylists); }