[BUG] Route parameter behavior is not consistent #17517
Labels
area-controls-shell
Shell Navigation, Routes, Tabs, Flyout
platform/iOS 🍎
s/triaged
Issue has been reviewed
t/bug
Something isn't working
Milestone
Description
Shell.Current.Navigation.PushAsync and Shell.Current.Navigation.PushModalAsync does call IQueryAttributable.ApplyQueryAttributes by default (with empty parameters) and does not allow you to pass in custom parameters.
Shell.Current.GoToAsync does not call IQueryAttributable.ApplyQueryAttributes by default and does allow you to pass in custom parameters.
These should behave in the same way. In my opinion, both should call IQueryAttributable.ApplyQueryAttributes by default and both should allow you to pass in your own route parameters.
If this gets picked up and a reproduction is desired, I will happily put something together.
Steps to Reproduce
Scenario #1
Scenario #2
Scenario #3
Link to public reproduction project repository
No response
Version with bug
7.0.92
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS, I was not able test on other platforms
Affected platform versions
iOS 16
Did you find any workaround?
With a bunch of custom code. I have a navigation abstraction so that I can control passing in route parameters. Because Shell.Current.GoToAsync won't call IQueryAttributable.ApplyQueryAttributes, I am passing a dummy route parameter to force it. That's gross, but I didn't see a better way.
I'm also wrapping PushAsync and PushModalAsync so that I can use dependency injection to initialize the page and view mdoel. That should also not be necessary - I should just be able to pass a type (e.g. Shell.Current.PushModalAsync(myRouteParameters, true) and it should get the page from the IoC, but that's a different issue.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: