Skip to content

Commit dfcf753

Browse files
committed
XAML parser now considers Source of Image and Class of UserControl/Window when trying to find proper name
1 parent 1d12727 commit dfcf753

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Parser/Flavors/XmlFlavorForXaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,15 @@ public sealed class XmlFlavorForXaml : XmlFlavor
7171
{ ElementNames.DataTemplate, AttributeNames.DataType },
7272
{ ElementNames.EventSetter, AttributeNames.Event },
7373
{ ElementNames.GlobalResourceDictionary, AttributeNames.Source },
74+
{ ElementNames.Image, AttributeNames.Source },
7475
{ ElementNames.ListView, AttributeNames.ItemsSource },
7576
{ ElementNames.Setter, AttributeNames.Property },
7677
{ ElementNames.StaticResource, AttributeNames.ResourceKey },
7778
{ ElementNames.Style, AttributeNames.TargetType },
7879
{ ElementNames.TextBlock, AttributeNames.Text },
7980
{ ElementNames.Trigger, AttributeNames.Property },
81+
{ ElementNames.UserControl, AttributeNames.Class },
82+
{ ElementNames.Window, AttributeNames.Class },
8083
};
8184

8285
public override bool ParseAttributesEnabled => false;
@@ -191,11 +194,14 @@ private static class ElementNames
191194
internal const string TextBlock = "TextBlock";
192195
internal const string TextBox = "TextBox";
193196
internal const string Trigger = "Trigger";
197+
internal const string UserControl = "UserControl";
198+
internal const string Window = "Window";
194199
}
195200

196201
private static class AttributeNames
197202
{
198203
internal const string AutomationId = "AutomationProperties.AutomationId";
204+
internal const string Class = "x:Class";
199205
internal const string Command = "Command";
200206
internal const string Content = "Content";
201207
internal const string DataType = "DataType";

0 commit comments

Comments
 (0)