Frame.SetNavigationState Frame.SetNavigationState Frame.SetNavigationState Frame.SetNavigationState Method

Definition

Overloads

SetNavigationState(String) SetNavigationState(String) SetNavigationState(String) SetNavigationState(String)

Reads and restores the navigation history of a Frame from a provided serialization string.

SetNavigationState(String, Boolean) SetNavigationState(String, Boolean) SetNavigationState(String, Boolean) SetNavigationState(String, Boolean)

Reads and restores the navigation history of a Frame from a provided serialization string.

SetNavigationState(String) SetNavigationState(String) SetNavigationState(String) SetNavigationState(String)

Reads and restores the navigation history of a Frame from a provided serialization string.

public : void SetNavigationState(Platform::String navigationState)
void SetNavigationState(winrt::hstring navigationState) const;
public void SetNavigationState(String navigationState)
Public Sub SetNavigationState(navigationState As String)

Parameters

navigationState
String String

The serialization string that supplies the restore point for navigation history.

Remarks

This method is useful to restore the navigation state of your app after it has been suspended and resumed. When your app is suspended, call GetNavigationState and save the return value. When your app is resumed, call SetNavigationState and pass it the saved value.

Calling SetNavigationState will call Page.OnNavigatedTo for the current page, with NavigationMode.Back. SetNavigationState is usually called when the application is being resumed, so the current page is navigated to.

SetNavigationState(String, Boolean) SetNavigationState(String, Boolean) SetNavigationState(String, Boolean) SetNavigationState(String, Boolean)

Reads and restores the navigation history of a Frame from a provided serialization string.

public : void SetNavigationState(Platform::String navigationState, bool suppressNavigate)
void SetNavigationState(winrt::hstring navigationState, bool suppressNavigate) const;
public void SetNavigationState(String navigationState, Boolean suppressNavigate)
Public Sub SetNavigationState(navigationState As String, suppressNavigate As Boolean)

Parameters

navigationState
String String

The serialization string that supplies the restore point for navigation history.

suppressNavigate
Boolean Boolean

true to restore navigation history without navigating to the current page; otherwise, false.

Additional features and requirements

Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

If you call SetNavigationState with the suppressNavigate parameter set to true, Page.OnNavigatedTo is not called for the current page. The current page is also put into the BackStack. When suppressing the transition, also be sure to use GoBack or GoForward to navigate to the correct page in the navigation history. NavigateTo is also supported, however the forward stack will be cleared when it is used.