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.

screen with a finger. With semantic zoom, you can zoom out to see headers, categories, or some other<br />

condensation of the data, and then tap on one of those items to zoom back into its section or group.<br />

The design guidance recommends having the zoomed-out view fit on one to three screenfuls at most,<br />

making it very easy to see and comprehend the whole data set.<br />

Go ahead and try semantic zoom through Scenario 2 of the ListView grouping and Semantic Zoom<br />

sample. To switch between the views, use pinch-zoom touch gestures, Ctrl+/Ctrl- keystrokes,<br />

Ctrl+mouse wheel, and/or a small zoom button that automatically appears in the lower-right corner of<br />

the control, as shown in Figure 5-5. When you zoom out, you’ll see a display of the group headers, as<br />

also shown in the figure.<br />

FIGURE 5-5 Semantic zoom between the two views in the ListView grouping and Semantic Zoom sample.<br />

The control itself is quite straightforward to use. In markup, declare a WinJS control using the<br />

WinJS.UI.SemanticZoom constructor. Within that element you then declare two (and only two) child<br />

elements: the first defining the zoomed-in view, and the second defining the zoomed-out view—always<br />

in that order. Here’s how the sample does it with two ListView controls (plus the template used for the<br />

zoomed-out view; I’m showing the code in the modified sample included with this chapter’s copanion<br />

content):<br />

<br />

<br />

<br />

<br />

<br />

<br />

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

Saved successfully!

Ooh no, something went wrong!