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