-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixed Query parameters not passed on Shell navigation #30034
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
base: main
Are you sure you want to change the base?
Conversation
… after app is loaded or resumed
Hey there @@Vignesh-SF3580! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
/azp run MAUI-UITests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures Shell query parameters are applied to pages before they’re cached, making them available during navigation. It also includes a UI test and sample pages to verify the fix.
- Assigns
QueryAttributes
to the created page before settingContentCache
inShellContent
. - Removes redundant query-parameter assignment block.
- Adds a HostApp sample and a Shared UI test for Issue 10509.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Controls/src/Core/Shell/ShellContent.cs | Apply QueryAttributesProperty before populating ContentCache |
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10509.cs | Add UI test to verify query parameter is passed on Shell navigation |
src/Controls/tests/TestCases.HostApp/Issues/Issue10509.cs | Add a Shell sample with two pages demonstrating query navigation |
Comments suppressed due to low confidence (1)
src/Controls/tests/TestCases.HostApp/Issues/Issue10509.cs:3
- The [Issue] attribute only lists PlatformAffected.Android, but the fix was validated on Android, Windows, iOS, and Mac. Consider updating the attribute to include all affected platforms for clarity.
[Issue(IssueTracker.Github, 10509, "Query parameter is missing after navigation", PlatformAffected.Android)]
Issue Detail
When navigating to a page using Shell with query parameters (e.g., via [QueryProperty]), the expected query value was not available during navigation.
Root Cause
In Shell navigation with query parameters, the query attributes were being set on the page after it was assigned to the Content property. As a result, the query value was not available when the navigation occurred.
Description of Change
The query parameters (QueryAttributesProperty) are now assigned to the page before it is set to ContentCache in ShellContent. This ensures the query value is available to the page before the Navigated event is triggered.
Tested the behavior in the following platforms
Issues Fixed
Fixes #10509
Fixes #11113
Fixes #29645
Screenshots
10509BeforeFix.mov
10509AfterFix.mov