Issue with NavigationPage Root Navigation in .NET MAUI - ANDROID #25187
Labels
area-navigation
NavigationPage
migration-compatibility
Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert
platform/android 🤖
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Milestone
Description
Hi Team,
In Xamarin Forms, I used a
NavigationPage
as myApp.MainPage
, and handled navigation viaNavigationPage.Navigation
. This approach worked well with the tools available in Xamarin Forms, particularly for navigation flows where the root page of the app changes—such as switching from a LoginPage (a full-screen page) to a FlyoutPage or even a TabbedPage as the new root page.As we know, the NavigationPage in Xamarin Forms did not allow direct changes to the root page. To work around this, I used the following pattern:
This approach involves inserting the new root page (FlyoutPage) before the current root page in the navigation stack and then popping to root. This pattern worked effectively and is also used by libraries like Sextant from ReactiveMarbles.
Steps to Reproduce
MainPage = new NavigationPage(new ContentPage());
ContentPage
, create a button that navigates you to aFlyoutPage
Expected Outcome
The expected outcome is that the Page on Android should look like this:
The Actual outcome
The FlyoutPage is not identified as Flyout, there is no Hamburguer button.
Link to public reproduction project repository
https://github.com/DanielCauser/SextantNavigation/tree/daca/maui_pure_as_sextant/SextantNavigation
Version with bug
8.0.40 SR5
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 13 and Above
Did you find any workaround?
There is known workaround that would still allow us to user NavigationPage as the main navigation source for the app.
The only way to make it work is to Change the
App.MainPage
, which breaks all the principles applied in enterprise projects.Relevant log output
No response
The text was updated successfully, but these errors were encountered: