HTML and CSS Reference
Implementing contracts and extensions requires writing code following strict rules and making
some changes to the application's manifest file. The purpose of the second requirement is informing
Windows about the system-wide changes that the application may introduce.
Consuming the File picker contract
Nearly any application needs to save data to the user's disk. When it comes to this, nearly any
application needs to be able to create and open files in folders. Sometimes the application can use
files and folders with fixed names and disk locations; sometimes, instead, it is preferable that the user
has the final word on the name of a given file and the location of the containing folder.
How would you let a user to choose a file name and a disk location?
This is precisely the purpose of the File picker contract. If you are familiar with earlier versions of
Windows, the concept behind file pickers should be nothing new: the File picker contract is just the
programming artifact necessary to implement a common dialog box, such as the one in Figure 9-3.
FIGURE 9-3 The File picker counterpart in Windows 7 and Windows 8 Desktop.
Let's extend the TodoList application you developed in Chapter 6 to consume file pickers and let
users choose a file and location where to save the task. You won't be dealing yet with the physical
details of how to create a file. You limit picking a file in this chapter and complete the exercise with
file and folder creation in the next chapter.