Problem with modal navigation #2811
-
Hi, i encounter a strange problem which i can't find a good solution for: Now i want to do something like this in the viewmodel of ModalViewB: According to the open issues "../" is currently not supported with a modal view. MauiProgram.LogNavigation|Navigation: ViewC, Result: Failed, Exception: Prism.Ioc.ContainerResolutionException: An unexpected error occurred while resolving 'Prism.Navigation.INavigationRegistry' I get the same error when trying to use "../ViewC" without GoBackAsync(). But this is not supposed to be supported atm. When instead doing: Not sure what triggers this strange error and how to work around it. Of course i can tell ViewModelA to do the desired navigation by providing some navigation hint in GoBackAsync, but that's a rather ugly workaround. Regards, Bernd |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
As you know, relative navigation is not supported with modal. You also can't remove a view from the nav stack with GoBack and then immediately navigate again because that view is no longer part of the navigation stack, so it will fail. One approach you could take it to send a parameter to the previous page in the modal GoBack that tell the page to perform its own relative goback. |
Beta Was this translation helpful? Give feedback.
As you know, relative navigation is not supported with modal. You also can't remove a view from the nav stack with GoBack and then immediately navigate again because that view is no longer part of the navigation stack, so it will fail. One approach you could take it to send a parameter to the previous page in the modal GoBack that tell the page to perform its own relative goback.