@ -323,25 +323,38 @@ namespace ICSharpCode.WpfDesign.XamlDom
// insert before specified index
// insert before specified index
collection . InsertBefore ( newChildNode , collectionElements [ index ] . GetNodeForCollection ( ) ) ;
collection . InsertBefore ( newChildNode , collectionElements [ index ] . GetNodeForCollection ( ) ) ;
}
}
}
}
internal XmlAttribute SetAttribute ( string value )
internal XmlAttribute SetAttribute ( string value )
{
{
string ns = ParentObject . OwnerDocument . GetNamespaceFor ( PropertyTargetType ) ;
string name ;
string name ;
var element = ParentObject . XmlElement ;
if ( IsAttached )
name = PropertyTargetType . Name + "." + PropertyName ;
if ( IsAttached )
else
{
name = PropertyName ;
name = PropertyTargetType . Name + "." + PropertyName ;
var element = ParentObject . XmlElement ;
string ns = ParentObject . OwnerDocument . GetNamespaceFor ( PropertyTargetType ) ;
if ( string . IsNullOrEmpty ( element . GetPrefixOfNamespace ( ns ) ) ) {
string prefix = element . GetPrefixOfNamespace ( ns ) ;
element . SetAttribute ( name , value ) ;
return element . GetAttributeNode ( name ) ;
if ( String . IsNullOrEmpty ( prefix ) )
} else {
{
element . SetAttribute ( name , ns , value ) ;
prefix = ParentObject . OwnerDocument . GetPrefixForNamespace ( ns ) ;
return element . GetAttributeNode ( name , ns ) ;
}
}
if ( ! string . IsNullOrEmpty ( prefix ) )
{
element . SetAttribute ( name , ns , value ) ;
return element . GetAttributeNode ( name , ns ) ;
}
}
else
{
name = PropertyName ;
}
element . SetAttribute ( name , value ) ;
return element . GetAttributeNode ( name ) ;
}
}
internal string GetNameForMarkupExtension ( )
internal string GetNameForMarkupExtension ( )