private void Frame_Navigated(object s, NavigationEventArgs e) { if (_navigationService == null) { _navigationService = (e.Content as PhoneApplicationPage)?.NavigationService; } RaiseNavigated(e.ToNavigationServiceNavigationEventArgs()); }
/// <summary> /// Invoked immediately after the page is unloaded and is no longer the current source of a parent frame. /// </summary> /// <param name="e">An object that contains the event data.</param> protected override async void OnNavigatedFrom(NavigationEventArgs e) { base.OnNavigatedFrom(e); var handler = DataContext as IHandleNavigatedFrom; if (handler != null) { await InvokeHandlerOnNavigatedFromAsync(handler, e.ToNavigationServiceNavigationEventArgs()); } }
/// <summary> /// Invoked immediately after the page is unloaded and is no longer the current source of a parent frame. /// </summary> /// <param name="e">An object that contains the event data.</param> protected override async void OnNavigatedFrom(NavigationEventArgs e) { base.OnNavigatedFrom(e); var viewModel = DataContext as IHandleNavigatedFrom; if (viewModel != null) { await viewModel.OnNavigatedFromAsync(e.ToNavigationServiceNavigationEventArgs()); } }