Replies: 3 comments 1 reply
-
We also notice the same message "NavigationPage has encountered an unhandled GoBack. Be sure to inherit from PrismNavigationPage." when we navigate back via the left-arrow icon in the navigation bar which the iOS shows automatically if you navigate to a page. We are using "Prism 9.0.401.20976" on iOS and Android. We even HAVE a class named "BaseNavigationPage" which inherits from PrismNavigationPage (like proposed in the warning) and it does the correct Back-button behaviour for Android, for iOS it has no logic but passes through the calls. I can see from the Prism Library source code where this warning message is printed out, but I don't understand it. Who sets the NavigationSource and why is this NavigationSource always set to "Device" when we use the Prism NavigationService in all places in our app? So is "Device" the correct NavigationSource? And if "yes", why we always see this warning message? Here is a sample navigation from a ListView to a detail page. We see that the PrismNavigationService is used and the NavigationSource is set to "Device", so when you navigate back from this detail page to the list page, you will again see this warning message:
@dansiegel Can you please perhaps help here? |
Beta Was this translation helpful? Give feedback.
-
We inherit from PrismNavigationPage in order to get more control over the properties of NavigationPage. In one particular situation, we want to show/hide NavigationPage.ToolbarItems (which is part of a NavigationPage). To do so, we created a MainNavigationPage which inherits from PrismNavigationPage and registered it in the DI container:
When we navigate paths like Some very important things I had to learn:
|
Beta Was this translation helpful? Give feedback.
-
You really shouldn't need to ever provide your own NavigationPage. It's a bit of a weird scenario IMO. You should be able to apply a global style to customize the look and feel. Prism.Maui automatically registers the PrismNavigationPage using the |
Beta Was this translation helpful? Give feedback.
-
In the PrismAppBuilder action on startup I initialise our navigation stack like this
My understanding is that the use of "NavigationPage" at the start of the uri is telling Prism to wrap Home in a Microsoft.Maui.Controls.NavigationPage.
When running the app in iOS I see a warning after pressing the "Back" button in the NavBar that says
All the Views in our app are ContentPages. What or where should I be inheriting from
PrismNavigationPage
?Beta Was this translation helpful? Give feedback.
All reactions