コード例 #1
0
        private async void MasterListView_ItemClick(object sender, ItemClickEventArgs e)
        {
            MyProgressRing.IsActive   = true;
            MyProgressRing.Visibility = Visibility.Visible;


            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;
        }
コード例 #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;
        }
コード例 #3
0
        private async void buttonSearch_Click(object sender, RoutedEventArgs e)
        {
            MarvelCharacter.Clear();
            MarvelComic.Clear();
            MarvelEvents.Clear();
            loadComics.Visibility = Visibility.Collapsed;
            hideComics.Visibility = Visibility.Collapsed;
            loadEvents.Visibility = Visibility.Collapsed;
            hideEvents.Visibility = Visibility.Collapsed;
            SearchedComicDetailNameTextBlock.Text        = "";
            SearchedComicDetailDescriptionTextBlock.Text = "";
            SearchedComicBuyTextBlock.Text  = "";
            SearchedComicDetailImage.Source = null;

            var searchedCharacter = textBoxSearch.Text;

            Task  t = MarvelFacade.FindMarvelCharactersAsync(MarvelCharacter, searchedCharacter);
            await t;

            try
            {
                if (MarvelCharacter[0].id > 100)
                {
                    loadComics.Visibility = Visibility.Visible;
                    loadEvents.Visibility = Visibility.Visible;
                }
            }
            catch (Exception)
            {
                return;
            }
        }
コード例 #4
0
        private async void Page_LoadedAsync(object sender, RoutedEventArgs e)
        {
            MyProgressRing.IsActive   = true;
            MyProgressRing.Visibility = Visibility.Visible;
            await MarvelFacade.PopulateMarvelCharactersAsync(MarvelCharacters);

            MyProgressRing.IsActive   = false;
            MyProgressRing.Visibility = Visibility.Collapsed;
        }
コード例 #5
0
        public async void Refresh()
        {
            MyProgressRing.IsActive   = true;
            MyProgressRing.Visibility = Visibility.Visible;

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

            MyProgressRing.IsActive   = false;
            MyProgressRing.Visibility = Visibility.Collapsed;
        }
コード例 #6
0
        private async void loadSearchedComics_Click(object sender, RoutedEventArgs e)
        {
            ProgressRing.IsActive   = true;
            ProgressRing.Visibility = Visibility.Visible;

            var searchedCharacterId = MarvelCharacter[0].id;

            loadComics.Visibility = Visibility.Collapsed;
            hideComics.Visibility = Visibility.Visible;

            MarvelComic.Clear();

            await MarvelFacade.PopulateMarvelComicsAsync(searchedCharacterId, MarvelComic);

            ProgressRing.IsActive   = false;
            ProgressRing.Visibility = Visibility.Collapsed;
        }
コード例 #7
0
        private async void loadEvents_Click(object sender, RoutedEventArgs e)
        {
            ProgressRing.IsActive   = true;
            ProgressRing.Visibility = Visibility.Visible;

            var searchedCharacterId = MarvelCharacter[0].id;

            loadEvents.Visibility = Visibility.Collapsed;
            hideEvents.Visibility = Visibility.Visible;

            MarvelEvents.Clear();

            await MarvelFacade.FindMarvelEventsAsync(MarvelEvents, searchedCharacterId);

            var searchedCharacterId2 = MarvelCharacter[0].id;

            ProgressRing.IsActive   = false;
            ProgressRing.Visibility = Visibility.Collapsed;
        }
コード例 #8
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     var data = MarvelFacade.GetCharacterList();
 }