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.

A common group of settings are those that allow the user to configure their roaming<br />

experience—that is, a group of settings that determine what state is roamed (you see this on PC Settings<br />

> Sync Your Settings). It is also recommended that you include account/profile management<br />

commands within Settings, as well as login/logout functionality. As noted in Chapter 7, logins and<br />

license agreements that are necessary to run the app at all should be shown upon launch. For ongoing<br />

login-related functions, and to review license agreements and such, create the necessary commands<br />

and panes within Settings. Refer to Guidelines and checklist for login controls for more information on<br />

this subject. Guidelines for a Help command can also be found on Adding app help.<br />

Behaviorally, settings panes are light-dismiss but also have a header with a back button to return to<br />

the primary settings pane with all the commands. Because of the light-dismiss behavior, changing a<br />

setting on a pane applies the setting immediately: there is no OK or Apply button or other such UI. If the<br />

user wants to revert a change, she should just restore the original setting.<br />

For this reason it’s a good idea to use simple controls that are easy to switch back, rather than<br />

complex sets of controls that would be difficult to undo. The recommendation is to use toggle switches<br />

for on/off values (rather than check boxes), a button to apply an action (but without closing the settings<br />

UI), hyperlinks (to open the browser), text input boxes (which should be set to the appropriate type such<br />

as email address, password, etc.), radio buttons for groups of up to five mutually exclusive items, and a<br />

listbox (select) control for four to six text-only items.<br />

In all your settings, think in terms of “less is more.” Avoid having all kinds of different settings,<br />

because if the user is never going to find them, you probably don’t need to surface them in the first<br />

place! Also, while a settings pane can scroll vertically, try to limit the overall size such that the user has to<br />

pan down only once or twice, if at all.<br />

Some other things to avoid with Settings:<br />

• Don’t use Settings for workflow-related commands. Those belong on the app bar or on the app<br />

canvas, as discussed in Chapter 7.<br />

• Don’t use a top-level command in the Settings pane to perform an action other than linking to<br />

another app (like the browser). That is, top-level commands should never execute an action<br />

within the app.<br />

• Don’t use settings commands to navigate within the app.<br />

• Don’t use WinJS.UI.SettingsFlyout as a general-purpose control.<br />

And on that note, let’s now look at the steps to use Settings and the SettingsFlyout properly!<br />

Populating Commands<br />

The first part of working with Settings is to provide your specific commands when the Settings charm is<br />

invoked. Unlike app bar commands, these should always be the same no matter the state of the app; if<br />

you have context-sensitive settings, place commands for those in the app bar.<br />

336

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

Saved successfully!

Ooh no, something went wrong!