public void DoOutsiderSearch(string term) { if (string.IsNullOrEmpty(term)) { SearchView.Visibility = Visibility.Collapsed; RegularView.Visibility = Visibility.Visible; } else { SearchView.Visibility = Visibility.Visible; RegularView.Visibility = Visibility.Collapsed; VM.SearchResults = _service.FullTextSearch(term); txtAutoComplete.Text = term; } }
void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { if (args.ChosenSuggestion != null) { var search_term = args.QueryText; VM.SearchResults = TodoService.FullTextSearch(search_term); } else { // Use args.QueryText to determine what to do. } }
void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { // Only get results when it was a user typing, // otherwise assume the value got filled in by TextMemberPath // or the handler for SuggestionChosen. if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { if (args.CheckCurrent()) { var search_term = txtAutoComplete.Text; if (string.IsNullOrEmpty(search_term)) { SearchView.Visibility = Visibility.Collapsed; RegularView.Visibility = Visibility.Visible; } else { SearchView.Visibility = Visibility.Visible; RegularView.Visibility = Visibility.Collapsed; VM.SearchResults = TodoService.FullTextSearch(search_term); } } } }