@ -4,22 +4,29 @@
using System ;
using System ;
using System.Windows ;
using System.Windows ;
using ICSharpCode.WpfDesign.XamlDom ;
using ICSharpCode.WpfDesign.XamlDom ;
using System.Collections ;
using System.Collections.Generic ;
namespace ICSharpCode.WpfDesign.Designer.Xaml
namespace ICSharpCode.WpfDesign.Designer.Xaml
{
{
sealed class XamlModelPropertyCollection : DesignItemPropertyCollection
sealed class XamlModelPropertyCollection : DesignItemPropertyCollection
{
{
XamlDesignItem _ item ;
XamlDesignItem _ item ;
Dictionary < string , XamlModelProperty > propertiesDictionary = new Dictionary < string , XamlModelProperty > ( ) ;
public XamlModelPropertyCollection ( XamlDesignItem item )
public XamlModelPropertyCollection ( XamlDesignItem item )
{
{
this . _ item = item ;
this . _ item = item ;
}
}
public override DesignItemProperty GetProperty ( string name )
public override DesignItemProperty GetProperty ( string name )
{
{
return new XamlModelProperty ( _ item , _ item . XamlObject . FindOrCreateProperty ( name ) ) ;
XamlModelProperty property ;
if ( propertiesDictionary . TryGetValue ( name , out property ) )
return property ;
property = new XamlModelProperty ( _ item , _ item . XamlObject . FindOrCreateProperty ( name ) ) ;
propertiesDictionary . Add ( name , property ) ;
return property ;
}
}
public override DesignItemProperty GetAttachedProperty ( Type ownerType , string name )
public override DesignItemProperty GetAttachedProperty ( Type ownerType , string name )