Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

CHAPTER 5: Life-Cycle Events > Implementing the Search Contract

Implementing the Search Contract

The suspending and resuming events are important, but I want to return to the activated event and show you how it can be used to get tighter integration between your app and the rest of the Metro system. To do this, I am going to implement a contract, which is how Windows 8 expresses some key aspects of the Metro user experience. I am going to implement the search contract, which tells Windows that my example application is capable of supporting the operating-system wide search mechanism. In the sections that follow, I'll show you how to declare support for the contract and implement the contract terms.

Declaring Support for the Contract

The first step toward implementing a contract is to update the manifest. Open the package.appxmanifest file, and switch to the Declarations tab. If you open the Available Declarations menu, you will see the lists of contracts that you can declare support for. Select Search and click the Add button. The Search contract will appear on the Supported Declarations list. Ignore the properties for the contract; they don't do anything for JavaScript Metro apps.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial