[XSG] support xClassModifier#31754
Merged
StephaneDelcroix merged 1 commit intonet10.0from Sep 25, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for the x:ClassModifier attribute in XAML source generation (XSG), allowing developers to specify the access modifier for generated partial classes.
- Adds
x:ClassModifierto the list of recognized XML attributes in XAML parsing - Updates visitors to skip processing
x:ClassModifieras a regular property - Updates test to validate that
x:ClassModifier="Internal"generates an internal partial class
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| XamlParser.cs | Adds recognition of x:ClassModifier attribute in XML parsing |
| ApplyPropertiesVisitor.cs | Adds x:ClassModifier to skip list to prevent it from being treated as a regular property |
| SetPropertiesVisitor.cs (SourceGen) | Adds x:ClassModifier to skip list in source generation visitor |
| SetPropertiesVisitor.cs (Build.Tasks) | Adds x:ClassModifier to skip list in build tasks visitor |
| BasicCase.cs | Updates test case to validate x:ClassModifier="Internal" generates internal class |
Comment on lines
+286
to
+287
| case "ClassModifier": | ||
| return XmlName.xClassModifier; |
There was a problem hiding this comment.
The implementation adds support for parsing x:ClassModifier but there's no corresponding definition of XmlName.xClassModifier. Please ensure this constant is defined in the XmlName class to avoid compilation errors.
jfversluis
approved these changes
Sep 24, 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
[XSG] support xClassModifier
Issues Fixed
Fixes #31550 (comment)