Description
The order in which Shell.Navigated and ApplyQueryAttributes are called changes depending on the type of navigation.
I suspect this might be related to one or more of following issues, so sorry if this is a duplicate.
#28453
#29428
#29272
Steps to Reproduce
- Clone the reproduction project repository
- Run the app
- Put breakpoints on
AppShell.NavigatedTo and the ApplyQueryAttributes for the two pages in the project
OtherPage should be the current Shell item. Click the "Click me" button to navigate to MainPage.
- Observe that
Shell.Navigated is called and then MainPage.ApplyQueryAttributes is called (this seems wrong, but if it was consistent then it would be acceptable)
- Click the "Click me" button on
MainPage to navigate back to OtherPage
- Observe that now
ApplyQueryAttributes is called first and then Shell.Navigated is called, presumably because an OtherPage has already been instantiated and is being reused.
- Now, open the flyout menu and select the second item titled something like "Title:...".
- Observe that
ApplyQueryAttributes now gets called with the same query parameters provided in step 4 above, followed by Shell.Navigated. Note that this happens even if the flyout item for MainPage is already the current item, except that in that case Shell.Navigated is NOT called (which probably makes sense).
- Open the flyout menu and click the first item titled "Other" and observe that
ApplyQueryAttributes is NOT called, despite it being provided query parameters in step 6 above (presumably because the instance being used was instantiated without query parameters when the app started?).
Link to public reproduction project repository
https://github.com/bzd3y/ShellContentOrderBug
Version with bug
9.0.70 SR7
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
Description
The order in which
Shell.NavigatedandApplyQueryAttributesare called changes depending on the type of navigation.I suspect this might be related to one or more of following issues, so sorry if this is a duplicate.
#28453
#29428
#29272
Steps to Reproduce
AppShell.NavigatedToand theApplyQueryAttributesfor the two pages in the projectOtherPageshould be the currentShellitem. Click the "Click me" button to navigate toMainPage.Shell.Navigatedis called and thenMainPage.ApplyQueryAttributesis called (this seems wrong, but if it was consistent then it would be acceptable)MainPageto navigate back toOtherPageApplyQueryAttributesis called first and thenShell.Navigatedis called, presumably because anOtherPagehas already been instantiated and is being reused.ApplyQueryAttributesnow gets called with the same query parameters provided in step 4 above, followed byShell.Navigated. Note that this happens even if the flyout item forMainPageis already the current item, except that in that caseShell.Navigatedis NOT called (which probably makes sense).ApplyQueryAttributesis NOT called, despite it being provided query parameters in step 6 above (presumably because the instance being used was instantiated without query parameters when the app started?).Link to public reproduction project repository
https://github.com/bzd3y/ShellContentOrderBug
Version with bug
9.0.70 SR7
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output