23.01.2018 Views

MICROSOFT_PRESS_EBOOK_PROGRAMMING_WINDOWS_8_APPS_WITH_HTML_CSS_AND_JAVASCRIPT_PDF

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

invoke the Settings charm. This is done through the settings pane object returned from<br />

Windows.UI.ApplicationSettings.SettingPane.getForCurrentView, whose show method display<br />

the UI (or throws a kindly exception if the app is in snapped view or doesn’t have the focus, so don’t<br />

invoke it under those conditions!). The edge property of the settings pane object also tells you if it’s on<br />

the left or right side of the screen, depending on the left-to-right or right-to-left orientation of the<br />

system as a whole (a regional variance).<br />

And with that we’ve covered all the methods and properties of this object! Yet the most interesting<br />

part is how we add our own commands to the settings pane. But let’s first look at the guidelines for<br />

using Settings.<br />

Design Guidelines for Settings<br />

Beyond the commands that Windows automatically adds to the settings pane, the app can provide up<br />

to eight others, typically around four; anything more than eight will throw an exception. Because<br />

settings are global to an app, the commands you add are always the same: they are not sensitive to<br />

context. To say it another way, the only commands that should appear on the settings pane are those<br />

that are global to the app; commands that apply only to certain pages or contexts within a page should<br />

appear on the app bar or on the app canvas. Some examples of commands on the top-level settings<br />

pane are shown in Figure 8-2.<br />

FIGURE 8-2 Examples of commands on the top-level settings pane. Notice that the lower section of the pane always<br />

has system settings and the app name and publisher always appear at the top. Permissions and Rate and Review are<br />

added automatically.<br />

334

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

Saved successfully!

Ooh no, something went wrong!