Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 2.22 KB

searchpane_querysubmitted.md

File metadata and controls

32 lines (21 loc) · 2.22 KB
-api-id -api-type
E:Windows.ApplicationModel.Search.SearchPane.QuerySubmitted
winrt event

Windows.ApplicationModel.Search.SearchPane.QuerySubmitted

-description

Fires when the user submits the text in the search box and the app needs to display search results.

-remarks

Important

To implement search in an app for Windows 10 or later, use AutoSuggestBox. See Auto-suggest box for more info.

You should not use Windows.ApplicationModel.Search APIs (SearchPane, SearchContract) or SearchBox APIs in apps for Windows 10 or later.

Note

An app can't use both the search box (Windows.UI.Xaml.Controls.SearchBox/WinJS.UI.SearchBox) and the SearchPane. Using both the search box and the search pane in the same app causes the app to throw an exception with this message: "Cannot create instance of type 'Windows.UI.Xaml.Controls.SearchBox.'"

If your app participates in the Search contract, register an event handler to respond when this event fires. In your QuerySubmitted event handler, respond by taking the user to your search results page and populating it with results based on the SearchPaneQuerySubmittedEventArgs.QueryText.

-examples

-see-also

Search contract sample (Windows 8), SearchPane class, SearchPane.QueryChanged event, SearchPaneQuerySubmittedEventArgs class