Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class SetPropertiesVisitor(ILContext context, bool stopOnResourceDictionary = fa
public static readonly IList<XmlName> skips = [
XmlName.xArguments,
XmlName.xClass,
XmlName.xClassModifier,
XmlName.xDataType,
XmlName.xFactoryMethod,
XmlName.xFieldModifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class SetPropertiesVisitor(SourceGenContext context, bool stopOnResourceDictiona
public static readonly IList<XmlName> skips = [
XmlName.xArguments,
XmlName.xClass,
XmlName.xClassModifier,
XmlName.xDataType,
XmlName.xFactoryMethod,
XmlName.xFieldModifier,
Expand Down
1 change: 1 addition & 0 deletions src/Controls/src/Xaml/ApplyPropertiesVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class ApplyPropertiesVisitor : IXamlNodeVisitor
public static readonly IList<XmlName> Skips = [
XmlName.xArguments,
XmlName.xClass,
XmlName.xClassModifier,
XmlName.xDataType,
XmlName.xFactoryMethod,
XmlName.xFieldModifier,
Expand Down
2 changes: 2 additions & 0 deletions src/Controls/src/Xaml/XamlParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ public static XmlName ParsePropertyName(XmlName name)
return XmlName.xFactoryMethod;
case "Arguments":
return XmlName.xArguments;
case "ClassModifier":
return XmlName.xClassModifier;
Comment on lines +286 to +287
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
default:
Debug.WriteLine("Unhandled attribute {0}", name);
return XmlName.Empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public void BasicXaml()
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Test.TestPage">
x:Class="Test.TestPage"
x:ClassModifier="Internal">
<Button x:Name="MyButton" Text="Hello MAUI!" />
</ContentPage>
""";
Expand All @@ -28,7 +29,7 @@ public void BasicXaml()
namespace Test;

[XamlProcessing(XamlInflator.SourceGen)]
public partial class TestPage : ContentPage
partial class TestPage : ContentPage
{
public TestPage()
{
Expand All @@ -53,12 +54,12 @@ public TestPage()
namespace Test;

[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Maui.Controls.SourceGen, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null", "10.0.0.0")]
public partial class TestPage
internal partial class TestPage
{
private partial void InitializeComponent()
{
var button = new global::Microsoft.Maui.Controls.Button();
global::Microsoft.Maui.VisualDiagnostics.RegisterSourceInfo(button!, new global::System.Uri(@"Test.xaml;assembly=SourceGeneratorDriver.Generated", global::System.UriKind.Relative), 6, 4);
global::Microsoft.Maui.VisualDiagnostics.RegisterSourceInfo(button!, new global::System.Uri(@"Test.xaml;assembly=SourceGeneratorDriver.Generated", global::System.UriKind.Relative), 7, 4);
var __root = this;
global::Microsoft.Maui.VisualDiagnostics.RegisterSourceInfo(__root!, new global::System.Uri(@"Test.xaml;assembly=SourceGeneratorDriver.Generated", global::System.UriKind.Relative), 2, 2);
#if !_MAUIXAML_SG_NAMESCOPE_DISABLE
Expand Down Expand Up @@ -87,4 +88,4 @@ private partial void InitializeComponent()

Assert.AreEqual(expected, generated);
}
}
}
Loading