void HandleNavigating(object sender, NavigatingCancelEventArgs e) { if (e.NavigationMode == Windows.UI.Xaml.Navigation.NavigationMode.Back) { return; } ProcessDataContext(e, (navigationAware, eventArgs, parent) => { if (eventArgs.Cancel) { return; } var mode = Translate(e.NavigationMode); var args = new NavigatingArgs(e.SourcePageType, mode); var messenger = Dependency.Resolve <IMessenger>(); messenger.PublishAsync(new NavigatingMessage(args)); navigationAware.HandleNavigatingFrom(args); if (eventArgs.Cancel) { parent?.ActivateViewModel((ViewModelBase)navigationAware); } }); }
void HandleNavigating(object sender, NavigatingCancelEventArgs e) { if (e.NavigationMode == BuiltInNavigation.NavigationMode.Back) { return; } ProcessDataContext(e, (navigationAware, eventArgs, parent) => { if (eventArgs.Cancel) { return; } var mode = Translate(e.NavigationMode); var args = new NavigatingArgs(e.Uri, mode, true, e.IsNavigationInitiator, e.ExtraData, e); var messenger = Dependency.Resolve <IMessenger>(); messenger.PublishAsync(new NavigatingMessage(args)); navigationAware.HandleNavigatingFrom(args); if (eventArgs.Cancel) { parent?.ActivateViewModel((ViewModelBase)navigationAware); } }); }