onbeforenavigate event

Applies to Windows and Windows Phone

A page navigation event that occurs before onnavigating and onnavigated. This event can be used to cancel navigation or perform other actions prior to navigation.

Syntax


WinJS.Navigation.addEventListener("beforenavigate", listenerName);
or
WinJS.Application.onbeforenavigate = listenerName;


Event information

SynchronousNo
BubblesYes
CancelableYes

Event handler parameters

eventInfo

Type: CustomEvent

An object that contains information about the event. The detail property of this object contains the following sub-properties:

  • location: The URI to navigate to.
  • state: One or more user-defined key-value pairs.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1

Namespace

WinJS.Navigation

Library

Base.js

See also

For developers
WinJS.Navigation Namespace
WinJS.UI.Hub object
WinJS.UI.AppBar object
WinJS.UI.NavBar object
WinJS.UI.BackButton object
Your first app - Part 3: PageControl objects and navigation
Navigating between pages
Adding app bars
Quickstart: Using single-page navigation
Quickstart: Adding a nav bar (NavBar)
Quickstart: Using a hub control for layout and navigation
HTML Hub control sample
HTML AppBar control sample
HTML NavBar control sample
Navigation and navigation history sample
For designers
Navigation patterns
Command patterns
Layout
Hub
Bottom app bar
Top app bar
Back button
Guidelines for the hub control
Guidelines for app bars
Making the app bar accessible

 

 

Show:
© 2014 Microsoft. All rights reserved.