Chapter 8. Searching

Searching is a core Windows Store app UX feature. Because most apps have a search function, Microsoft decided that in Windows Store apps it would be best for search to be implemented in two common ways.

If the user wants to find something in your app, he or she will either swipe in the charms, access the Search feature, type in the keywords, and touch the search button, or use the SearchBox control, which will let the user search from within the application. It’s your responsibility to present to the user the results and any UI elements needed to refine the search. (These refinement UI elements are called filters.)

What we’re going to do in this chapter is add search through the charms bar, and then take a look at the SearchBox. The guidelines for search recommend strongly that you use only one of the two. The hardest part of the implementation is rendering the search results and this is done the same way for both solutions. While we have chosen the charm search, replacing it with the SearchBox won’t require a lot of work, as you will see later. Since this is one area that has undergone a lot of change, I would keep my eye on the documentation and the guidelines in case one of the two methods becomes the preferred one. When the user wants to search, we’ll present a user interface that will use the MyGridView control that we built previously, together with a custom item template designed to render ReportViewItem instances in search results mode. If you remember ...

Get Programming Windows Store Apps with C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.