Search code examples
searchwindows-8microsoft-metrocharms-bar

search contract within the Metro app of Windows8


I would like to know how can I implement the search contract from within the app, to search/find a few files present inside the application.

As far as I know, there are a lot of articles especially from msdn, blogs, etc which helps us create a normal search contract to search/look for apps/books, etc on win8 system, but I have not come across any valuable source for implementing search within the app.

Your response will eb of great help to me :) Thanks in advance..!


Solution

  • As I know, you can add a search contract using Add a New Item command in Visual Studio. The IDE will register the appropriate handlers to catch QuerySubmitted event or Search Activated events. The former is used for capturing search event while your application is the main app on screen and the second one is for situations where your application is not running as the active app.

    What you search in your application isn't important. It's completely your own business. You can search for files inside your apps or anything else.

    Recently I've read an article on MSDN about this. Maybe useful for you too

    Adding search to an app

    Also similar issue here on StackOverflow