Understanding Navigation State

When building a multi-page app with the Navigation API, you can take advantage of Navigation state to preserve state as you navigate back and forth between pages. Each entry in history has a state property associated with it. You can assign whatever value that you want to this state property.

Imagine, for example, that you are building a simple product catalog. The app consists of only two pages: a home page, which displays a list of categories, and a details page, which displays a list of matching products (see Figures 12.7 and 12.8). When you click a category on the home page then you see a list of matching products on the details page.

FIGURE 12.7 The store app home page

FIGURE 12.8 The store app details page ...

Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.