Share via


SystemNavigationManager Class

Definition

Provides a way for an app to respond to system provided back-navigation events.

public ref class SystemNavigationManager sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class SystemNavigationManager final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class SystemNavigationManager
Public NotInheritable Class SystemNavigationManager
Inheritance
Object Platform::Object IInspectable SystemNavigationManager
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

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

Gets or sets a value that indicates whether a back button is shown in the system UI.

Methods

GetForCurrentView()

Returns the SystemNavigationManager object associated with the current window.

Events

BackRequested

Occurs when the user invokes the system provided button, gesture, or voice command for back-navigation.

Applies to

See also