diff --git a/src/Controls/src/Core/NavigationPage/NavigationPage.cs b/src/Controls/src/Core/NavigationPage/NavigationPage.cs index 7607799ce09c..d2bff039e407 100644 --- a/src/Controls/src/Core/NavigationPage/NavigationPage.cs +++ b/src/Controls/src/Core/NavigationPage/NavigationPage.cs @@ -54,7 +54,7 @@ public partial class NavigationPage : Page, IPageContainer, IBarElement, I INavigationPageController NavigationPageController => this; - + partial void Init(); #if WINDOWS || ANDROID || TIZEN @@ -64,7 +64,7 @@ public partial class NavigationPage : Page, IPageContainer, IBarElement, I #endif bool _setForMaui; - + /// public NavigationPage() : this(UseMauiHandler) { @@ -714,9 +714,9 @@ private protected override void OnHandlerChangedCore() var visiblePage = Navigation.NavigationStack[NavigationStack.Count - 1]; RootPage = navStack[0]; CurrentPage = visiblePage; - + var navigationType = DetermineNavigationType(); - + SendHandlerUpdateAsync(false, null, () => { @@ -736,13 +736,13 @@ private protected override void OnHandlerChangedCore() ((IStackNavigation)this).NavigationFinished(this.NavigationStack); } } - + NavigationType DetermineNavigationType() { var parentPages = this.GetParentPages(); bool hasTabOrFlyout = parentPages.Any(page => page is FlyoutPage or TabbedPage); - + if (hasTabOrFlyout) { return NavigationType.Replace; @@ -750,7 +750,7 @@ NavigationType DetermineNavigationType() return NavigationType.Push; } - + // Once we get all platforms over to the new APIs // we can just delete all the code inside NavigationPage.cs that fires "requested" events class MauiNavigationImpl : NavigationProxy @@ -894,7 +894,7 @@ protected override Task OnPushAsync(Page root, bool animated) Owner.NavigationType = navigationType; // Move the SendNavigating here so that it's fired prior to the stack being modified // This ensures consistent event ordering across all platforms (iOS, Catalyst, Android, Windows) - Owner.SendNavigating(previousPage); + Owner.SendNavigating(navigationType, previousPage); Owner.PushPage(root); }, () =>