0
votes

I would like to clear the search box in metro search charm after the user accepted one of the result suggestion my app is providing to the charm. How? Sounds easy but it is not, SearchPane.QueryText is read only.

I am actually surprised by the default system behavior. After the user accepted the ResultSuggestion (please remember to distinguish from QuerySuggestion) it does not make sense in my eyes to pre-populate the search box with this accepted result...

2

2 Answers

1
votes

Try

var searchPane = Windows.ApplicationModel.Search.SearchPane.getForCurrentView();
searchPane.trySetQueryText("myQueryText");
0
votes

The user's text stays there in case after looking at one of the results they decide "oh that's not it, I will look at this other result from" and the other result could even be from a different app. There is no way for an app to override this.