-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] GetNavigationUriPath For Maui #3092
Comments
Hello @Axemasta I am also facing this issue when I am migration Xamarin.Forms application to MAUI. Please let me know if you have any workaround to get NavigationStack in MAUI then please share. will be really appreciated. Thanks. |
@NiranjanXamarin codes like this:
|
@maonaoda thanks alot. You saved my time. Appreciated |
Hello. I don't know if there's a setting missing or if there's a problem. The versions of the related libraries are as follows:
|
@maonaoda can you explain how this works public XXXViewModel(IPageAccessor pageAccessor){ because it return list of pages but GetNavigationUriPath was return stack navigation as a string |
I think this gives the same result var path = string.Join("/", navStack.Select(x => x.GetType().Name)); |
Summary
In Prism Forms we had the extension method
GetNavigationUriPath
, which when called would give you the current Uri of theINavigationService
. In maui this extension no longer exists and reading the current Uri from a Viewmodel is incredibly difficult. We can observe the current Uri using the global navigation observer, however performing viewmodel based logic on the current Uri path is difficult.API Changes
Add a new
INavigationServiceExtension
method namedGetNavigationUriPath
Intended Use Case
Performing logic in a view model based on the page uri stack. For example we could have a Login page which can be accessed in multiple ways:
The text was updated successfully, but these errors were encountered: