diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlDocument.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlDocument.cs index b517eea9f0..b09468d7c8 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlDocument.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlDocument.cs @@ -219,14 +219,14 @@ namespace ICSharpCode.WpfDesign.XamlDom return new XamlObject(this, xml, elementType, instance); } - internal string GetNamespaceFor(Type type) + internal string GetNamespaceFor(Type type, bool getClrNamespace = false) { if (type == typeof (DesignTimeProperties)) return XamlConstants.DesignTimeNamespace; if (type == typeof (MarkupCompatibilityProperties)) return XamlConstants.MarkupCompatibilityNamespace; - return _typeFinder.GetXmlNamespaceFor(type.Assembly, type.Namespace); + return _typeFinder.GetXmlNamespaceFor(type.Assembly, type.Namespace, getClrNamespace); } internal string GetPrefixForNamespace(string @namespace) diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlProperty.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlProperty.cs index 9e95465448..8379cbd291 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlProperty.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlProperty.cs @@ -317,10 +317,11 @@ namespace ICSharpCode.WpfDesign.XamlDom { var localName = elementType.Name + "." + propertyName; var namespaceURI = xamlDocument.GetNamespaceFor(elementType); + var clrNamespaceURI = xamlDocument.GetNamespaceFor(elementType, true); foreach (XmlNode childNode in node.ChildNodes) { - if (childNode.LocalName == localName && childNode.NamespaceURI == namespaceURI) + if (childNode.LocalName == localName && (childNode.NamespaceURI == namespaceURI || childNode.NamespaceURI == clrNamespaceURI)) { return childNode; } diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlTypeFinder.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlTypeFinder.cs index 81f6a4c50c..b072c0ccbc 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlTypeFinder.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlTypeFinder.cs @@ -117,11 +117,11 @@ namespace ICSharpCode.WpfDesign.XamlDom /// /// Gets the XML namespace that can be used for the specified assembly/namespace combination. /// - public string GetXmlNamespaceFor(Assembly assembly, string @namespace) + public string GetXmlNamespaceFor(Assembly assembly, string @namespace, bool getClrNamespace = false) { AssemblyNamespaceMapping mapping = new AssemblyNamespaceMapping(assembly, @namespace); string xmlNamespace; - if (reverseDict.TryGetValue(mapping, out xmlNamespace)) { + if (!getClrNamespace && reverseDict.TryGetValue(mapping, out xmlNamespace)) { return xmlNamespace; } else { return "clr-namespace:" + mapping.Namespace + ";assembly=" + mapping.Assembly.GetName().Name;