-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[NET10] Add compiled binding for SafeAreaEdgesTypeConverter #31015
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
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/rebase |
fc0421d to
b85fee1
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
left a comment
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.
The sample build tests are failing (XAMLC error):
Example:
C:\a\_work\1\s\src\Controls\samples\Controls.Sample.Sandbox\SandboxShell.xaml : XamlC error : Value cannot be null. (Parameter 'type') [C:\a\_work\1\s\src\Controls\samples\Controls.Sample.Sandbox\Maui.Controls.Sample.Sandbox.csproj::TargetFramework=net9.0-tizen]
C:\a\_work\1\s\src\Controls\samples\Controls.Sample.Sandbox\SandboxShell.xaml : XamlC error : Value cannot be null. (Parameter 'type') [C:\a\_work\1\s\src\Controls\samples\Controls.Sample.Sandbox\Maui.Controls.Sample.Sandbox.csproj::TargetFramework=net9.0-maccatalyst]
C:\a\_work\1\s\src\Controls\samples\Controls.Sample.Sandbox\SandboxShell.xaml : XamlC error : Value cannot be null. (Parameter 'type') [C:\a\_work\1\s\src\Controls\samples\Controls.Sample.Sandbox\Maui.Controls.Sample.Sandbox.csproj::TargetFramework=net9.0-ios]
C:\a\_work\1\s\src\Controls\samples\Controls.Sample.Sandbox\SandboxShell.xaml : XamlC error : Value cannot be null. (Parameter 'type') [C:\a\_work\1\s\src\Controls\samples\Controls.Sample.Sandbox\Maui.Controls.Sample.Sandbox.csproj::TargetFramework=net9.0-windows10.0.19041.0]
C:\a\_work\1\s\src\Controls\samples\Controls.Sample.Sandbox\SandboxShell.xaml : XamlC error : Value cannot be null. (Parameter 'type') [C:\a\_work\1\s\src\Controls\samples\Controls.Sample.Sandbox\Maui.Controls.Sample.Sandbox.csproj::TargetFramework=net9.0-windows10.0.20348.0]
C:\a\_work\1\s\src\Controls\samples\Controls.Sample.Sandbox\SandboxShell.xaml : XamlC error : Value cannot be null. (Parameter 'type') [C:\a\_work\1\s\src\Controls\samples\Controls.Sample.Sandbox\Maui.Controls.Sample.Sandbox.csproj::TargetFramework=net9.0-android]
14 Warning(s)
6 Error(s)
@copilot Review
The XAMLC error occurs because this PR is targeting the The compiled converter tries to reference types that don't exist in Solution: This PR needs to target the I'll need to close this PR and create a new one targeting net10.0, or the base branch needs to be changed to net10.0. |
jsuarezruiz
left a comment
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.
@copilot The Safe Area feature is included in net10.0. You should retarget this PR or close this one and open a new one targeting net10.0 branch,
I've identified the root cause of the XAMLC errors - this PR targets Unfortunately, I don't have permissions to change the PR base branch or close/reopen PRs. The team will need to either:
The code implementation is correct and ready - it just needs to be on the right branch where SafeAreaEdges types exist. |
|
/rebase |
b85fee1 to
ab4e463
Compare
|
/rebase |
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
ab4e463 to
f54d83d
Compare
|
/azp run MAUI-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@copilot Build errors ##[error]src/Controls/tests/Xaml.UnitTests/SafeAreaEdgesCompiledBindingTests.cs(16,46): Error CS0122: 'TestSafeAreaEdgesPage.stackUniform' is inaccessible due to its protection level |
Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com>
... Fixed the CS0122 accessibility errors in commit 3aaec9d. The issue was that test classes were trying to access XAML-generated private fields from a separate file. Consolidated the tests into a proper code-behind file ( |
|
I don't think this is going the right way, closing and revisiting later |
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
This PR implements compiled binding support for
SafeAreaEdgesTypeConverterto improve XAML parsing performance by generating IL code at build time instead of using reflection at runtime.Changes Made:
Added Compiled Type Converter (
src/Controls/src/Build.Tasks/CompiledConverters/SafeAreaEdgesTypeConverter.cs)ICompiledTypeConverterinterface"All"→new SafeAreaEdges(SafeAreaRegions.All)"All,None"→new SafeAreaEdges(SafeAreaRegions.All, SafeAreaRegions.None)"All,None,Container,SoftInput"→new SafeAreaEdges(SafeAreaRegions.All, SafeAreaRegions.None, SafeAreaRegions.Container, SafeAreaRegions.SoftInput)Registered Converter (
src/Controls/src/Build.Tasks/XamlCache.cs)Added Tests (
src/Controls/tests/Xaml.UnitTests/TestSafeAreaEdgesPage.xaml.cs)The implementation follows the same patterns used by other compiled converters like
ThicknessTypeConverterandCornerRadiusTypeConverter.Issues Fixed
Fixes #30816
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.