Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit bd82815

Browse files
committed
Fixed prefix lookup.
1 parent debb148 commit bd82815

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObject.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ internal XmlAttribute XmlAttribute {
116116
static XmlElement VirualAttachTo(XmlElement e, XmlElement target)
117117
{
118118
var prefix = target.GetPrefixOfNamespace(e.NamespaceURI);
119+
120+
if (String.IsNullOrEmpty(prefix) && target.OwnerDocument.DocumentElement != null)
121+
{
122+
prefix = target.OwnerDocument.DocumentElement.GetPrefixOfNamespace(e.NamespaceURI);
123+
}
124+
119125
XmlElement newElement = e.OwnerDocument.CreateElement(prefix, e.LocalName, e.NamespaceURI);
120126

121127
foreach (XmlAttribute a in target.Attributes) {

0 commit comments

Comments
 (0)