WinJS.Navigation Namespace
Provides functionality for managing navigation, including the navigation stack.
The Microsoft Visual Studio project templates for Windows apps using JavaScript (Hub, Grid, Split, and Navigation) use the single-page navigation model. In this model, HTML pages are loaded via the page's URI into a single, app-wide context. The pages are loaded as needed, typically in response to user actions. See JavaScript project templates for Windows Store apps to get an overview of the templates.
For help choosing the best navigation pattern for your app, see Navigation patterns.
See the Flat navigation and Hierarchical navigation patterns in action as part of our App features, start to finish series.
The WinJS.Navigation namespace has these types of members:
- Properties
- Functions
- Events
Properties
Property | Description |
---|---|
Identifies whether it is possible to traverse backward through the navigation stack. |
|
Identifies whether it is possible to traverse forward through the navigation stack. |
|
Gets or sets the navigation stack. |
|
Gets a URI for an app page. |
|
Gets or sets one or more user-defined key-value pairs that can be passed between pages. |
Functions
Function | Description |
---|---|
Adds an event listener to the control. |
|
Traverses backward in the navigation stack. |
|
Traverses forward in the navigation stack. |
|
Removes an event listener from the control. |
Events
Event | Description |
---|---|
A page navigation event that occurs before onnavigating and onnavigated. |
|
A page navigation event that occurs after onbeforenavigate and onnavigating. |
|
A page navigation event that occurs after onbeforenavigate and before onnavigated. |
Requirements
Minimum WinJS version |
WinJS 1.0 |
Namespace |
WinJS.Navigation |
See also
For developers
Your first app - Part 3: PageControl objects and navigation
Quickstart: Using single-page navigation
Quickstart: Adding a nav bar (NavBar)
Quickstart: Using a hub control for layout and navigation
Navigation and navigation history sample
For designers
Top app bar
Guidelines for the hub control
Guidelines for app bars