Fixed content update issue when changing the ControlTemplate at runtime for a ContentPage#28216
Merged
rmarinho merged 2 commits intodotnet:mainfrom Mar 17, 2025
Merged
Fixed content update issue when changing the ControlTemplate at runtime for a ContentPage#28216rmarinho merged 2 commits intodotnet:mainfrom
rmarinho merged 2 commits intodotnet:mainfrom
Conversation
Contributor
|
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. |
Contributor
There was a problem hiding this comment.
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.
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
rmarinho
approved these changes
Mar 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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