File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
src/tools/Avalonia.Generators/Common
tests/Avalonia.Generators.Tests/Views Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ IXamlAstNode IXamlAstVisitor.Visit(IXamlAstNode node)
38
38
{
39
39
if ( child is XamlAstXamlPropertyValueNode propertyValueNode &&
40
40
propertyValueNode . Property is XamlAstNamePropertyReference namedProperty &&
41
+ ! IsAttachedProperty ( namedProperty ) &&
41
42
namedProperty . Name == "Name" &&
42
43
propertyValueNode . Values . Count > 0 &&
43
44
propertyValueNode . Values [ 0 ] is XamlAstTextNode text )
@@ -89,4 +90,9 @@ private string TryGetFieldModifier(XamlAstObjectNode objectNode)
89
90
_ => _defaultFieldModifier
90
91
} ;
91
92
}
93
+
94
+ private static bool IsAttachedProperty ( XamlAstNamePropertyReference namedProperty )
95
+ {
96
+ return ! namedProperty . DeclaringType . Equals ( namedProperty . TargetType ) ;
97
+ }
92
98
}
Original file line number Diff line number Diff line change 2
2
xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
3
3
x : Class =" Sample.App.NamedControl" >
4
4
<TextBox Name =" UserNameTextBox"
5
+ AutomationProperties.Name=" The user name"
5
6
Watermark =" Username input"
6
7
UseFloatingWatermark =" True" />
7
- </Window >
8
+ </Window >
Original file line number Diff line number Diff line change 2
2
xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
3
3
x : Class =" Sample.App.xNamedControl" >
4
4
<TextBox x : Name =" UserNameTextBox"
5
+ AutomationProperties.Name=" The user name"
5
6
Watermark =" Username input"
6
7
UseFloatingWatermark =" True" />
7
- </Window >
8
+ </Window >
You can’t perform that action at this time.
0 commit comments