Share via


Page.OnNavigatedFrom(NavigationEventArgs) Method

Definition

Invoked immediately after the Page is unloaded and is no longer the current source of a parent Frame.

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

Parameters

e
NavigationEventArgs

Event data that can be examined by overriding code. The event data is representative of the navigation that has unloaded the current Page.

Remarks

OnNavigatedFrom is invoked by default when you navigate between pages in your app. You can override this method and get info about the navigation from the NavigationEventArgs, and take any action required by your app.

In addition to being invoked when navigating between pages, the OnNavigatedFrom method is invoked when Frame.GetNavigationState is called. To avoid any issues, you should use OnNavigatingFrom or the Unloaded event, which are only called on actual navigation, to unregister event handlers and do other cleanup.

Applies to