diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs index 12c55ae18..3f6f5943b 100644 --- a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs @@ -1667,6 +1667,13 @@ namespace Ricciolo.StylesExplorer.MarkupReflection || (elementDeclaration.Type != null && declaration.Type != null && elementDeclaration.Type.IsSubclassOf(declaration.Type))) return String.Empty; } + else if (node is XmlBamlPropertyElement) + { + XmlBamlPropertyElement property = (XmlBamlPropertyElement)node; + declaration = property.TypeDeclaration; + if (property.Parent.TypeDeclaration.Type.IsSubclassOf(property.PropertyDeclaration.DeclaringType.Type)) + declaration = property.Parent.TypeDeclaration; + } else if (node is XmlBamlElement) declaration = ((XmlBamlElement)node).TypeDeclaration; else diff --git a/ILSpy.BamlDecompiler/Tests/Cases/CustomControl.cs b/ILSpy.BamlDecompiler/Tests/Cases/CustomControl.cs new file mode 100644 index 000000000..257884e07 --- /dev/null +++ b/ILSpy.BamlDecompiler/Tests/Cases/CustomControl.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; + +namespace ILSpy.BamlDecompiler.Tests.Cases +{ + public class CustomControl : Control + { + } +} diff --git a/ILSpy.BamlDecompiler/Tests/Cases/NamespacePrefix.xaml b/ILSpy.BamlDecompiler/Tests/Cases/NamespacePrefix.xaml new file mode 100644 index 000000000..f37ac2f5e --- /dev/null +++ b/ILSpy.BamlDecompiler/Tests/Cases/NamespacePrefix.xaml @@ -0,0 +1,12 @@ + +