Dela via


Page.OnNavigatedTo(NavigationEventArgs) Method

Definition

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

protected:
 virtual void OnNavigatedTo(NavigationEventArgs ^ e) = OnNavigatedTo;
void OnNavigatedTo(NavigationEventArgs const& e);
protected virtual void OnNavigatedTo(NavigationEventArgs e);
function onNavigatedTo(e)
Protected Overridable Sub OnNavigatedTo (e As NavigationEventArgs)

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