Skip to content

Latest commit

 

History

History
57 lines (34 loc) · 3.6 KB

searchsuggestioncollection_appendresultsuggestion_603544202.md

File metadata and controls

57 lines (34 loc) · 3.6 KB
-api-id -api-type
M:Windows.ApplicationModel.Search.SearchSuggestionCollection.AppendResultSuggestion(System.String,System.String,System.String,Windows.Storage.Streams.IRandomAccessStreamReference,System.String)
winrt method

Windows.ApplicationModel.Search.SearchSuggestionCollection.AppendResultSuggestion

-description

Appends a suggested search result to the list of suggestions to display in the search pane.

-parameters

-param text

The text of the suggested result.

-param detailText

The detail text for the suggested result.

-param tag

The unique tag that identifies this suggested result.

If this suggested result is selected by the user, a ResultSuggestionChosen event occurs. When the app handles this event, it can get the tag of the chosen result suggestion from the SearchPaneResultSuggestionChosenEventArgs.Tag property.

-param image

The image to accompany the results suggestion. The image should be 40 x 40. Windows will scale or crop smaller or larger images.

-param imageAlternateText

The alternate text for the image.

-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.

You should use result suggestions instead of query suggestions only to display high-confidence results that take the user directly to the item instead of to a view that shows search results.

Suggested results include an image and optional detail text to display with the suggestion in the search pane. The image signals to the user that they are seeing results and not query suggestions. If an image for the result doesn't exist, you can use a generic image or icon that represents the result or result type.

You must listen for and handle the ResultSuggestionChosen event if you want to provide result suggestions.

The search pane can display 5 suggestions, at most. Additionally, each separator you use takes the place of a suggestion and lowers the number of suggestions that you can display.

-examples

-see-also

Search contract sample (Windows 8), SearchSuggestionCollection class, SearchPane.SuggestionsRequested event, SearchPane.ResultSuggestionChosen event, SearchPaneSuggestionsRequestedEventArgs class, SearchPaneSuggestionsRequestedEventArgs.Request property, SearchPaneSuggestionsRequest class, SearchPaneSuggestionsRequest.SearchSuggestionCollection property