Ejemplo n.º 1
0
 private void mysearchBox_QuerySubmitted(Windows.UI.Xaml.Controls.SearchBox sender, SearchBoxQuerySubmittedEventArgs args)
 {
     {
         if (args.QueryText == "Apple")
         {
             this.Frame.Navigate(typeof(Apple));
         }
     }
 }
Ejemplo n.º 2
0
        private void mysearchBox_SuggestionsRequested(Windows.UI.Xaml.Controls.SearchBox sender, SearchBoxSuggestionsRequestedEventArgs args)
        {
            SearchSuggestionCollection search = args.Request.SearchSuggestionCollection;

            if (args.QueryText.StartsWith("a", StringComparison.CurrentCultureIgnoreCase))
            {
                search.AppendQuerySuggestion("Apple");
                search.AppendQuerySuggestion("Almonds");
                search.AppendQuerySuggestion("Anmimals");
            }
            else if (args.QueryText.StartsWith("b", StringComparison.CurrentCultureIgnoreCase))
            {
                search.AppendQuerySuggestion("Banana");
                search.AppendQuerySuggestion("Bat");
            }
        }