private async void OnPersonNameTextBoxChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { try { this.personNameTextBox.ItemsSource = await BingSearchHelper.GetAutoSuggestResults(this.personNameTextBox.Text); } catch (HttpRequestException) { // default to no suggestions this.personNameTextBox.ItemsSource = null; } }
private async void OnTagNameTextBoxChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { try { this.tagNameTextBox.ItemsSource = await BingSearchHelper.GetAutoSuggestResults(this.tagNameTextBox.Text); } catch (HttpRequestException) { // default to no suggestions this.tagNameTextBox.ItemsSource = null; } } }
private async void OnSearchTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { try { this.searchBox.ItemsSource = await BingSearchHelper.GetAutoSuggestResults(this.searchBox.Text, GetBingSearchMarketFromLanguage(this.languageComboBox.SelectedValue.ToString())); } catch (HttpRequestException) { // default to no suggestions this.searchBox.ItemsSource = null; } } }
private async void onTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { try { this.autoSuggestBox.ItemsSource = await BingSearchHelper.GetAutoSuggestResults(this.autoSuggestBox.Text); } catch (Exception) { this.autoSuggestBox.ItemsSource = null; } } else if (args.Reason == AutoSuggestionBoxTextChangeReason.ProgrammaticChange && !string.IsNullOrEmpty(this.autoSuggestBox.Text)) { await QueryBingImages(this.autoSuggestBox.Text); } }