23.01.2018 Views

MICROSOFT_PRESS_EBOOK_PROGRAMMING_WINDOWS_8_APPS_WITH_HTML_CSS_AND_JAVASCRIPT_PDF

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Activation of a File Picker Provider<br />

Demonstrations of the file picker provider contracts—for open and save—are found in the File picker<br />

contracts sample, which I’ll refer to as the provider sample for clarity. Declarations for both are included<br />

in the manifest with Supports Any File Type, so the sample will be listed with other apps in all file<br />

pickers, as shown here:<br />

When invoked, the Start page listed in the manifest for the appropriate contract (open or save) is<br />

loaded. These are fileOpenPicker.html and fileSavePicker.html, found in the root of the project. Both of<br />

these pages are again loaded independently of the main app and appear as shown in Figures 12-15 and<br />

12-16. Note that the title of the app and the color scheme is determined by the Application UI settings<br />

in the provider app’s manifest. In particularly, the text comes from the Display Name field and the colors<br />

come from the Foreground Text and Background Color settings under Tile, as shown in Figure 12-17.<br />

Note that the system automatically adds the down chevron (⌄) next to the title in Figures 12-15 and<br />

12-16 through which the user can select a different picker location or provider app.<br />

FIGURE 12-15 The Open UI as displayed by the sample.<br />

533

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!