SystemNavigationManager
SystemNavigationManager
SystemNavigationManager
SystemNavigationManager
Class
Definition
Provides a way for an app to respond to system provided back-navigation events.
public : sealed class SystemNavigationManager : ISystemNavigationManager, ISystemNavigationManager2public sealed class SystemNavigationManager : ISystemNavigationManager, ISystemNavigationManager2Public NotInheritable Class SystemNavigationManager Implements ISystemNavigationManager, ISystemNavigationManager2// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Remarks
The SystemNavigationManager lets you respond to user presses of the system provided back button such as a hardware button, or gestures and voice commands that activate the same event.
To enable your app to respond to the system back-navigation event, call GetForCurrentView to get the SystemNavigationManager object associated with the current view, then register an event handler for the BackRequested event. Your app will receive the event only of it's the foreground app. If you handle the BackRequested event, set the BackRequestedEventArgs.Handled property to true to mark the event as handled. If you don't mark the event as handled, the system decides whether to navigate away from the app (on the Mobile device family) or ignore the event (on the Desktop device family).
If the device doesn't provide any back-navigation button, gesture, or command, the event is not raised.
Properties
AppViewBackButtonVisibility AppViewBackButtonVisibility AppViewBackButtonVisibility AppViewBackButtonVisibility
Gets or sets a value that indicates whether a back button is shown in the system UI.
public : AppViewBackButtonVisibility AppViewBackButtonVisibility { get; set; }public AppViewBackButtonVisibility AppViewBackButtonVisibility { get; set; }Public ReadWrite Property AppViewBackButtonVisibility As AppViewBackButtonVisibility// You can use this property in JavaScript.
- Value
- AppViewBackButtonVisibility AppViewBackButtonVisibility AppViewBackButtonVisibility AppViewBackButtonVisibility
One of the enumeration values that specifies whether a back button is shown in the system UI. The default is Collapsed.
Remarks
If your app relies on a system provided back button, like the back button on a phone, you can opt-in to showing a system back button on device platforms that don't have a system back button by default, such as a desktop device.
Methods
GetForCurrentView() GetForCurrentView() GetForCurrentView() GetForCurrentView()
Returns the SystemNavigationManager object associated with the current window.
public : static SystemNavigationManager GetForCurrentView()public static SystemNavigationManager GetForCurrentView()Public Static Function GetForCurrentView() As SystemNavigationManager// You can use this method in JavaScript.
The SystemNavigationManager object associated with the current window.
Events
BackRequested BackRequested BackRequested BackRequested
Occurs when the user invokes the system provided button, gesture, or voice command for back-navigation.
public : event EventHandler BackRequested<BackRequestedEventArgs>public event EventHandler BackRequested<BackRequestedEventArgs>Public Event BackRequested<BackRequestedEventArgs>// You can use this event in JavaScript.