-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[XF] CreateTab and SelectedTab not supported in NavigationParameters class #1391
Comments
Yes, I am aware of this. As of now, this is how the feature was designed. I will have to discuss with the team if we want to change how this works and support the NavigationParameters class too. |
I have a couple of concerns about implementing this. First, there would be an immediate limitation of not being able to deep link into an app that has multiple TabbedPages. This is because both TabbedPages would read the NavParams class and create tabs based on those values. This could be very bad, and there is no way to control it. Another problem is the amount of code churn and logic that would need to be added to the NavigationService to support this. The safest and most reliable way to do this would be to keep it in the query string. However, if there is an overwhelming request from the community, we can add it, but will have to note the known limitation which many people won't know about until they actually run into the problem and open an issue here :) Thoughts? |
After thinking about this more, I have decided not to suppor this for the reasons I outline in my previous comment. However, you can still use the NavigationParameters class if you like, you just have to provide them inline in the URI like you outlined in your example. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
I created a small sample solution using the latest NuGet version of Prism.Forms 7.0.0.396 that reproduces the bug(s).
Navigating to a TabbedPage using NavigationParameters to create and select a tab does not really work unless you specify the parameters within the query string. If you use the overload with the NavigationParameters param, they are not respected or it even fails with a NullReferenceException.
Steps to Reproduce
The parameters ->
Navigation ->
Note the '+' which concatenates the parameters to an entire query string.
Whereas the first approach using the parameter overload does not work.
Using a more complex scenario it even throws an exception:
Just using the query string works:
Expected Behavior
Exact same navigation behavior like using parameters within the query string.
Actual Behavior
Navigation parameters in query string are treated differently.
Basic Information
Reproduction Sample
NavParams.zip
The text was updated successfully, but these errors were encountered: