Esempio n. 1
0
        private async void MasterListView_ItemClick(object sender, ItemClickEventArgs e)
        {
            MyProgressRing.IsActive   = true;
            MyProgressRing.Visibility = Visibility.Visible;

            ComicDetailNameTextBlock.Text        = "";
            ComicDetailDescriptionTextBlock.Text = "";
            ComicBuyTextBlock.Text  = "";
            ComicDetailImage.Source = null;

            var selectedCharacter = (Character)e.ClickedItem;

            DetailNameTextBlock.Text        = selectedCharacter.name;
            DetailDescriptionTextBlock.Text = selectedCharacter.description;

            var largeImage = new BitmapImage();
            Uri uri        = new Uri(selectedCharacter.thumbnail.large, UriKind.Absolute);

            largeImage.UriSource = uri;
            DetailImage.Source   = largeImage;

            MarvelComics.Clear();

            await MarvelFacade.PopulateMarvelComicsAsync(selectedCharacter.id, MarvelComics);

            MyProgressRing.IsActive   = false;
            MyProgressRing.Visibility = Visibility.Collapsed;
        }
Esempio n. 2
0
        private async void buttonRefresh_Click(object sender, RoutedEventArgs e)
        {
            MarvelCharacters.Clear();
            MarvelComics.Clear();
            DetailNameTextBlock.Text        = "";
            DetailDescriptionTextBlock.Text = "";
            DetailImage.Source                   = null;
            ComicDetailNameTextBlock.Text        = "";
            ComicDetailDescriptionTextBlock.Text = "";
            ComicBuyTextBlock.Text               = "";
            ComicDetailImage.Source              = null;

            MyProgressRing.IsActive   = true;
            MyProgressRing.Visibility = Visibility.Visible;

            while (MarvelCharacters.Count < 10)
            {
                Task  t = MarvelFacade.PopulateMarvelCharactersAsync(MarvelCharacters);
                await t;
            }


            MyProgressRing.IsActive   = false;
            MyProgressRing.Visibility = Visibility.Collapsed;
        }