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 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ILSpy.BamlDecompiler/Tests/ILSpy.BamlDecompiler.Tests.csproj b/ILSpy.BamlDecompiler/Tests/ILSpy.BamlDecompiler.Tests.csproj
index 143e1ce06..e62c07756 100644
--- a/ILSpy.BamlDecompiler/Tests/ILSpy.BamlDecompiler.Tests.csproj
+++ b/ILSpy.BamlDecompiler/Tests/ILSpy.BamlDecompiler.Tests.csproj
@@ -74,6 +74,7 @@
AttachedEvent.xaml
Code
+
MyControl.xaml
Code
@@ -127,6 +128,7 @@
+
Always
diff --git a/ILSpy.BamlDecompiler/Tests/TestRunner.cs b/ILSpy.BamlDecompiler/Tests/TestRunner.cs
index 59b50143d..063d471c8 100644
--- a/ILSpy.BamlDecompiler/Tests/TestRunner.cs
+++ b/ILSpy.BamlDecompiler/Tests/TestRunner.cs
@@ -79,6 +79,12 @@ namespace ILSpy.BamlDecompiler.Tests
RunTest("cases/simplepropertyelement");
}
+ [Test]
+ public void NamespacePrefix()
+ {
+ RunTest("cases/namespaceprefix");
+ }
+
#region RunTest
void RunTest(string name)
{