Add overrides to Help with Obsoleting Compatibility.Layout#30058
Merged
Add overrides to Help with Obsoleting Compatibility.Layout#30058
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds protected overrides of OnSizeAllocated to maintain binary compatibility with existing consumers when Compatibility.Layout is removed.
- Introduces
OnSizeAllocatedoverrides inTemplatedView,ScrollView, andContentPresenter - Updates PublicAPI.Unshipped files to expose the new overrides
- Ensures future binary compatibility with libraries compiled against MAUI
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/Controls/src/Core/TemplatedView/TemplatedView.cs | Added OnSizeAllocated override and compatibility comments |
| src/Controls/src/Core/ScrollView/ScrollView.cs | Added OnSizeAllocated override and compatibility comments |
| src/Controls/src/Core/ContentPresenter.cs | Added OnSizeAllocated override and compatibility comments |
| src/Controls/src/Core/PublicAPI/*/PublicAPI.Unshipped.txt | Exposed the new overrides in all target frameworks' unshipped APIs |
Comments suppressed due to low confidence (1)
src/Controls/src/Core/TemplatedView/TemplatedView.cs:146
- There are no existing tests covering the new
OnSizeAllocatedoverride. Please add or update test cases in TestCases.Shared.Tests and TestCases.HostApp to verify this method is invoked correctly.
protected override void OnSizeAllocated(double width, double height)
d117d11 to
990cc0b
Compare
jfversluis
approved these changes
Jun 24, 2025
NanthiniMahalingam
pushed a commit
to NanthiniMahalingam/maui
that referenced
this pull request
Jun 27, 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
We had a few vendors test out the follow PR #29281 and they reported crashes on
OnSizeAllocated.If we add these overrides to the base classes that we are keeping and then 3rd parties recompile, that will better prepare us down the road for hopefully getting to delete
Compatibility.Layout