Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I programmatically clear the SearchBox control history in Windows 8.1?

Windows 8.1 introduced a new control: SearchBox. It has a feature that remembers user searches which is good, but I want to allow the user to clear the search history. How do I implement that in code?

like image 915
satur9nine Avatar asked Sep 18 '13 18:09

satur9nine


1 Answers

There is a ClearHistory method on the SearchSuggestionManager class that clears all search history contexts.

Code in C#:

var manager = new Windows.ApplicationModel.Search.Core.SearchSuggestionManager();
manager.ClearHistory();
like image 187
Nathan Kuchta Avatar answered Sep 22 '22 06:09

Nathan Kuchta