Skip to content
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

[XamlC] Avoid calling ResourceDictionary.SetAndLoadSource #20776

Merged

Conversation

simonrozsival
Copy link
Member

Description of Change

This PR adds a separate method in ResourceDictionary that compiled RDSourceTypeConverter can call and which will be more efficient.

The old SetAndLoadSource is still needed when we're parsing XAML at runtime. It doesn't have to be public anymore because it is now only intended to be called from the non-compiled RDSourceTypeConverter.

Issues Fixed

Fixes #19648

@simonrozsival simonrozsival requested a review from a team as a code owner February 22, 2024 14:25
@jsuarezruiz jsuarezruiz added the area-xaml XAML, CSS, Triggers, Behaviors label Feb 22, 2024
Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build is failing

D:\a\_work\1\s\.buildtasks\Microsoft.Maui.Controls.targets(154,3): error : Member '__XamlGeneratedCode__.__TypeD79CA40995E82F1C' is declared in another module and needs to be imported [D:\a\_work\1\s\src\Controls\tests\Xaml.UnitTests\Controls.Xaml.UnitTests.csproj]
    7057 Warning(s)
    1 Error(s)

@simonrozsival
Copy link
Member Author

@rmarinho please take another look, that bug is fixed now

@rmarinho
Copy link
Member

This would be a breaking change right? so we would need a breaking change doc ?

@simonrozsival
Copy link
Member Author

@rmarinho yes, this would be a breaking change in .NET 9. The API is not supposed to be used by developers directly. The XamlC generates calls to these methods.

@StephaneDelcroix StephaneDelcroix merged commit a2f567b into dotnet:net9.0 Mar 27, 2024
47 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants