Maui and Regions #2882
-
I will re-phrase my question to be more specific regarding the use of Regions. I am creating a simple sample Maui application that loads a module and is capable of navigating between the module's two pages. The Maui application defines a single ContentPage as follows...
The region the module's views will be loaded into is named "ContentRegion". Much of the application startup is cribbed from Dan's sample code. I have done my best to sort out the intent of the Region code but I confess there is some of the code that does not make sense to me.
There are two views ( of type ContentView) in this module that basically navigate back and forth with each other for the purpose of the sample. A sign-in page and a sign-up page. The issue I am running into is that when clicking on the SignUp link Navigation fails. I think it may be because I don't have the Navigation URL correct for the modules page. Below is the Command binding used to navigate to the modules SignUpPageView
I built a sample app that did not use regions, and this navigate command worked fine, so I suspect I have missed something fundamental with the RegionManager version. The error dumped by the GlobalNavigationObserver is ... Any thoughts on what might be the issue here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I was able to resolve the issue by passing an IRegionManager to the view model constructors and using the RequestNavigate method on the IRegionManager interface. _regionManager.RequestNavigate("ContentRegion", URI); I am not clear if this is the "correct" way to do navigation rendering a module's view(s) into the applications content area so if anyone has additional insight into this problem please feel free to add on to this discussion. |
Beta Was this translation helpful? Give feedback.
I was able to resolve the issue by passing an IRegionManager to the view model constructors and using the RequestNavigate method on the IRegionManager interface.
_regionManager.RequestNavigate("ContentRegion", URI);
I am not clear if this is the "correct" way to do navigation rendering a module's view(s) into the applications content area so if anyone has additional insight into this problem please feel free to add on to this discussion.