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.

• Message dialogs (Windows.UI.Popups.MessageDialog) are used to ask questions that the user<br />

must answer or acknowledge before the app can proceed; a message dialog disables the rest of<br />

the app. Message dialogs are best used for errors or conditions that affect the whole app; error<br />

messages that are specific to page content should appear inline.<br />

• The app bar is a WinJS control on which you can place standard commands, using the<br />

commands layout, or any <strong>HTML</strong> of your choice, using the custom layout. Custom icons are also<br />

possible, using different fonts or custom graphics. An app can have both a top and a bottom app<br />

bar, where the top is typically used for navigation and employs a custom layout. App bars can be<br />

sticky to keep them visible instead of being light-dismissed.<br />

• The app bar’s showCommands, hideCommands, and showOnlyCommands methods, along with the<br />

extraClass property of commands, make it easy to define an app bar in a single location in the<br />

app and to selectively show specific command sets by using querySelectorAll with a class that<br />

represents that set.<br />

• Command menus, as appear from an app bar command or an on-canvas control of some kind,<br />

are implemented with the WinJS.UI.Menu control.<br />

• As an example of using many of these features, the Here My Am! app is updated in this chapter<br />

to greatly improve its handling of various error conditions.<br />

310

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

Saved successfully!

Ooh no, something went wrong!