-api-id | -api-type |
---|---|
E:Windows.ApplicationModel.Search.SearchPane.ResultSuggestionChosen |
winrt event |
Fires when the user selects one of the suggested results that was provided by the app and displayed in the search pane.
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 and displays suggestions for possible results in the search pane, you should register an event handler to respond when this event fires. In your ResultSuggestionChosen event handler, respond by getting the SearchPaneResultSuggestionChosenEventArgs.Tag of the chosen result and using it to take the user to the result in your app UI.
Note
If you want to display result suggestions, you must also listen for and handle the SuggestionsRequested event.
Search contract sample (Windows 8), Object class, SearchPane class, SearchPane.SuggestionsRequested event, SearchPaneResultSuggestionChosenEventArgs class