private async void MasterListView_ItemClick(object sender, ItemClickEventArgs e) { try { MyProgressRing.IsActive = true; MyProgressRing.Visibility = Visibility.Visible; var selectedCharacter = (Character)e.ClickedItem; DetailNameTextBlock.Text = selectedCharacter.name; DetailDescriptionTextBlock.Text = selectedCharacter.description; var larImage = new BitmapImage(); Uri uri = new Uri(selectedCharacter.thumbnail.large, UriKind.Absolute); larImage.UriSource = uri; DetailImage.Source = larImage; MarvelComics.Clear(); // Clearing up last data (if any) await MarvelFacade.PopulateMarvelComicsAsync(selectedCharacter.id, MarvelComics); ComicNameTextBlock.Text = null; ComicDescriptionTextBlock.Text = null; ComicImage = null; MyProgressRing.IsActive = false; MyProgressRing.Visibility = Visibility.Collapsed; } catch (Exception) { } }
public async void refresh() { try { MyProgressRing.IsActive = true; MyProgressRing.Visibility = Visibility.Visible; MarvelCharcters.Clear(); while (MarvelCharcters.Count < 20) { Task t = MarvelFacade.PopulateMarvelCharactersAsync(MarvelCharcters); await t; } MyProgressRing.IsActive = false; MyProgressRing.Visibility = Visibility.Collapsed; } catch (Exception) { } }
private async void Page_Loaded(object sender, RoutedEventArgs e) { var storageFile = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///VoiceCommandDictionary.xml")); await Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.InstallCommandDefinitionsFromStorageFileAsync(storageFile); try { MyProgressRing.IsActive = true; MyProgressRing.Visibility = Visibility.Visible; while (MarvelCharcters.Count < 20) { Task t = MarvelFacade.PopulateMarvelCharactersAsync(MarvelCharcters); await t; } MyProgressRing.IsActive = false; MyProgressRing.Visibility = Visibility.Collapsed; } catch (Exception) { } }
private async void autoBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { try { await MarvelFacade.getCharactersByQuery(MarvelCharcters, autoBox.Text); } catch (Exception) { } }