private void QuerySubmitted(Windows.UI.Xaml.Controls.AutoSuggestBox sender, Windows.UI.Xaml.Controls.AutoSuggestBoxQuerySubmittedEventArgs args) { // Navigate to search page App.NavigateTo(typeof(SearchView), SearchBox.Text); // Hide the popup Hide(); }
/// <summary> /// Initializes a new instance of the <see cref="AutoSuggestBox"/> class /// </summary> public AutoSuggestBox() { #if !NETSTANDARD2_0 NativeAutoSuggestBox = new NativeAutoSuggestBox( #if __ANDROID__ Android.App.Application.Context #endif ); NativeAutoSuggestBox.SuggestionChosen += (s, e) => { SuggestionChosen?.Invoke(this, new AutoSuggestBoxSuggestionChosenEventArgs(e.SelectedItem)); }; NativeAutoSuggestBox.TextChanged += (s, e) => { suppressTextChangedEvent = true; Text = NativeAutoSuggestBox.Text; suppressTextChangedEvent = false; TextChanged?.Invoke(this, new AutoSuggestBoxTextChangedEventArgs((AutoSuggestionBoxTextChangeReason)e.Reason)); }; NativeAutoSuggestBox.QuerySubmitted += (s, e) => QuerySubmitted?.Invoke(this, new AutoSuggestBoxQuerySubmittedEventArgs(e.QueryText, e.ChosenSuggestion)); #else throw new PlatformNotSupportedException(); #endif }
private void AutoSuggestBox_QuerySubmitted(Windows.UI.Xaml.Controls.AutoSuggestBox sender, Windows.UI.Xaml.Controls.AutoSuggestBoxQuerySubmittedEventArgs args) { sender.ItemsSource = string.IsNullOrWhiteSpace(args.QueryText) ? null : suggestions; }
private void Control_QuerySubmitted(Windows.UI.Xaml.Controls.AutoSuggestBox sender, Windows.UI.Xaml.Controls.AutoSuggestBoxQuerySubmittedEventArgs args) { InputPane.GetForCurrentView().TryHide(); }
private void Search_QuerySubmitted(Windows.UI.Xaml.Controls.AutoSuggestBox sender, Windows.UI.Xaml.Controls.AutoSuggestBoxQuerySubmittedEventArgs args) { ViewModel.SearchTerm = args.QueryText; ViewModel.SearchClick(); }
public void MakeFocus() { #if __ANDROID__ NativeAutoSuggestBox.MakeRequestFocus(); #endif }