Navigation.state property
Gets or sets one or more user-defined key-value pairs that can be passed between pages. Use with navigate.
Syntax
var myState = WinJS.Navigation.state;
Property value
Type: Object
A comma-separated list of user-defined key-value pairs.
Examples
Here, we pass form input ("name1" and "name2") to page 2 of an app and display the value of "name1" in a dialog.
WinJS.Navigation.navigate("/pages/page2.html",
{ name1: "name1", name2: "name2" });
if (nav.state.name1) {
var messageDialog =
new Windows.UI.Popups.MessageDialog(nav.state.name1);
}
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