5
我正在为WPF和Silverlight定制控件。这种控制具有复杂类型的集合属性,它是抽象的,就像这样:Visual Studio 2010设计时间集合编辑器
public Collection<MyBase> Configuration
{
get { return (Collection<MyBase>)GetValue(ConfigurationProperty); }
set { SetValue(ConfigurationProperty, value); }
}
// Using a DependencyProperty as the backing store for Configuration This enables animation, styling, binding, etc...
public static readonly DependencyProperty ConfigurationProperty =
DependencyProperty.Register("Configuration", typeof(Collection<MyBase>), typeof(MyControl), new PropertyMetadata(new ObservableCollection<MyBase>()));
我的问题是,我不能将新项目添加到这个属性在Visual Studio 2010的设计,因为它不知道任何派生类型的MyBase。
是否有任何方法向设计师注册这些类型?编辑器可以正常使用现有的项目,并且可以删除和修改它们。图片说明: