Skip to content

Further remove dependency of Compatibility.Layout on all modern .NET MAUI controls#30672

Merged
PureWeen merged 11 commits intonet10.0from
copilot/fix-28736-2
Jul 18, 2025
Merged

Further remove dependency of Compatibility.Layout on all modern .NET MAUI controls#30672
PureWeen merged 11 commits intonet10.0from
copilot/fix-28736-2

Conversation

Copy link
Contributor

Copilot AI commented Jul 17, 2025

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.Layout but 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 the Compatibility.Layout

We have also implemented a property that will detect if the Compatibility.Layout is being used with any of our modern layouts. If it is then we just bypass all of the Compatibility.Layout logic so that it doesn't interfere with performance or the MAUI logic

Issues Fixed

Fixes #28736

Copilot AI requested a review from PureWeen July 17, 2025 04:15
@PureWeen PureWeen force-pushed the copilot/fix-28736-2 branch from a89e768 to cf343fe Compare July 17, 2025 04:16
@PureWeen PureWeen changed the base branch from main to net10.0 July 17, 2025 04:16
@PureWeen
Copy link
Member

Copy all the files from this PR into this PR
#29281

@PureWeen PureWeen changed the title [WIP] Further remove dependency of Compatibility.Layout on all modern .NET MAUI controls Further remove dependency of Compatibility.Layout on all modern .NET MAUI controls Jul 17, 2025
Copy link
Contributor Author

Copilot AI commented Jul 17, 2025

Copy all the files from this PR into this PR
#29281

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.

@PureWeen PureWeen force-pushed the copilot/fix-28736-2 branch from 6d39be1 to ae74da4 Compare July 17, 2025 04:40
@PureWeen
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen marked this pull request as ready for review July 17, 2025 04:50
Copilot AI review requested due to automatic review settings July 17, 2025 04:50
@PureWeen PureWeen requested a review from a team as a code owner July 17, 2025 04:50
@PureWeen PureWeen added the p/0 Current heighest priority issues that we are targeting for a release. label Jul 17, 2025
@PureWeen PureWeen added this to the .NET 10.0-preview7 milestone Jul 17, 2025
Copy link
Contributor

Copilot AI left a 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 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 Arrange API.
  • Introduced a CrossPlatformLayout property and measure/arrange overrides in MauiSwipeRefreshLayout and 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 enable may 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 CrossPlatformLayout property in this class; the original check used CrossPlatformMeasure. Please update this condition to reference the correct delegate or property.
			if (CrossPlatformLayout is null)

@PureWeen PureWeen force-pushed the copilot/fix-28736-2 branch from d9925a3 to 47b7623 Compare July 17, 2025 13:09
@PureWeen
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI and others added 10 commits July 17, 2025 18:35
…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
@PureWeen PureWeen force-pushed the copilot/fix-28736-2 branch from d7c8d46 to abd9719 Compare July 17, 2025 23:39
@PureWeen
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

mattleibow
mattleibow previously approved these changes Jul 18, 2025
@github-project-automation github-project-automation bot moved this from Ready To Review to Approved in MAUI SDK Ongoing Jul 18, 2025
@PureWeen
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
Copy link
Member

  • failing test unrelated

@PureWeen PureWeen merged commit 1e3d94b into net10.0 Jul 18, 2025
126 of 129 checks passed
@PureWeen PureWeen deleted the copilot/fix-28736-2 branch July 18, 2025 03:58
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing Jul 18, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Aug 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

p/0 Current heighest priority issues that we are targeting for a release.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Further remove dependency of Compatibility.Layout on all modern .NET MAUI controls

5 participants