Page.OnNavigatedTo(NavigationEventArgs) Method

Definition

Invoked when the Page is loaded and becomes the current source of a parent Frame.

C#
protected virtual void OnNavigatedTo(NavigationEventArgs e);

Parameters

e
NavigationEventArgs

Event data that can be examined by overriding code. The event data is representative of the pending navigation that will load the current Page. Usually the most relevant property to examine is Parameter.

Remarks

Unlike in prior XAML platforms, the OnNavigated method is called before the visual tree is loaded. This has the following implications:

  • You cannot access a valid Parent property value from an override of OnNavigated. If you need to access the Parent property, do so in a Loaded event handler.
  • You cannot use OnNavigatedTo for element manipulation or state change of controls on the destination page. Instead, attach a Loaded event handler at the root of the newly loaded page's content, and perform any element manipulations, state changes, event wiring and so on in the Loaded event handler.

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100