-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fixed content update issue when changing the ControlTemplate at runtime for a ContentPage #28216
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
Conversation
Hey there @sheiksyedm! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
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.
PR Overview
This PR addresses the issue of updating a ControlTemplate at runtime for a ContentPage by adding support similar to that already implemented for TemplatedView.
- Added automated tests in TestCases.Shared.Tests and TestCases.HostApp to validate the functionality.
- Updated TemplatedPage.cs to trigger a content update through the handler when the template is applied.
Reviewed Changes
File | Description |
---|---|
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue15649.cs | New automated test to verify dynamic template updates on a ContentPage. |
src/Controls/tests/TestCases.HostApp/Issues/Issue15649.xaml.cs | UI logic for the test case, including updating the PositionSelected property. |
src/Controls/src/Core/TemplatedPage.cs | Updated implementation to support dynamic ControlTemplate updates for pages. |
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/Controls/tests/TestCases.HostApp/Issues/Issue15649.xaml.cs:6
- Consider making the backing field '_positionSelected' private to better encapsulate its usage and adhere to C# naming conventions for backing fields.
public int _positionSelected = 1;
Changes added.
/azp run |
Azure Pipelines successfully started running 3 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.
LGTM
Description of Change
Implementation for dynamically updating the ControlTemplate was not added for TemplatedPage, whereas it was already supported for TemplatedView (ContentView). The support has now been added for TemplatedPage based on the TemplatedView implementation
Issues Fixed
Fixes #15649