Further remove dependency of Compatibility.Layout on all modern .NET MAUI controls#30672
Further remove dependency of Compatibility.Layout on all modern .NET MAUI controls#30672
Conversation
a89e768 to
cf343fe
Compare
|
Copy all the files from this PR into this PR |
I'm copying all the files from PR #29281 into this PR. This includes removing deprecated CarouselPage-related files, updating ContentPresenter to work with the new layout system, and modernizing various handlers and renderers. This is a comprehensive refactor that removes dependency on legacy compatibility layout features. |
6d39be1 to
ae74da4
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull Request Overview
This PR removes the dependency on Compatibility.Layout for modern .NET MAUI controls by copying public APIs into the derived types and bypassing compatibility logic when a modern layout is used.
- Benchmarks updated to use the new
ArrangeAPI. - Introduced a
CrossPlatformLayoutproperty and measure/arrange overrides inMauiSwipeRefreshLayoutand related handlers. - Core controls refactored to implement cross-platform measure/arrange, deprecate old APIs, and update unit tests.
Reviewed Changes
Copilot reviewed 71 out of 77 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Core/tests/Benchmarks/Benchmarks/FlexLayoutBenchmarker.cs | Switched from Layout to Arrange in the benchmark. |
| src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt | Adjusted public API entries for Android. |
| src/Core/src/Platform/Android/MauiSwipeRefreshLayout.cs | Added CrossPlatformLayout and override methods. |
| src/Core/src/Platform/Android/ContentViewGroup.cs | Updated null-check for layout delegates. |
| src/Core/src/Handlers/ScrollView/ScrollViewHandler.Android.cs | Changed alignment logic in Android scroll view handler. |
Comments suppressed due to low confidence (2)
src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt:1
- The leading BOM character before
#nullable enablemay cause parsing issues; remove the BOM so the file starts exactly with#nullable enable.
#nullable enable
src/Core/src/Platform/Android/ContentViewGroup.cs:61
- There is no
CrossPlatformLayoutproperty in this class; the original check usedCrossPlatformMeasure. Please update this condition to reference the correct delegate or property.
if (CrossPlatformLayout is null)
d9925a3 to
47b7623
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
…d modernize layout system Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com> # Conflicts: # src/Compatibility/Core/src/iOS/Renderers/CarouselPageRenderer.cs # src/Controls/src/Core/Platform/Windows/FormsListView.cs
# Conflicts: # src/Controls/src/Core/ClippedToBoundsElement.cs # src/Controls/src/Core/ContentPresenter.cs # src/Controls/src/Core/IClippedToBoundsElement.cs # src/Controls/src/Core/InputTransparentContainerElement.cs # Conflicts: # src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt # src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt
d7c8d46 to
abd9719
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
Ideally we will eventually be able to remove
Compatibility.Layoutbut we are still in a state where if users have overridden certain methods or are calling some properties that are still on Compatibility.Layout then the binary isn't compatible. This PR copies all of the public APIs to the subclasses so whenever users override or call those methods/properties on the base class the IL will resolved to the derived type vs theCompatibility.LayoutWe have also implemented a property that will detect if the
Compatibility.Layoutis being used with any of our modern layouts. If it is then we just bypass all of theCompatibility.Layoutlogic so that it doesn't interfere with performance or the MAUI logicIssues Fixed
Fixes #28736