Blend4属性值可扩展性 [英] Blend4 property value extensibility
问题描述
我在混合4中创建了一个silverlight 项目。 自定义控件可以在混合中显示。 我想改变的属性值编辑器,但 到目前为止  I 没有获得成功 
I create an silverlight project in blend 4. custom control can be displayed in blend. I want to change property value editor, but so far I don't get successful.
[汇编:ProvideMetadata(typeof运算(SilverlightControl.Expression.Design.metadata)) ] $
名称空间SilverlightControl.Expression.Design
{
公共类元数据:IProvideAttributeTable
{
private static AttributeTable _customAttributes;
[assembly: ProvideMetadata(typeof(SilverlightControl.Expression.Design.metadata))]
namespace SilverlightControl.Expression.Design
{
public class metadata : IProvideAttributeTable
{
private static AttributeTable _customAttributes;
public AttributeTable AttributeTable
{
获取{
if(_customAttributes == null)
{
                    _customAttributes =新AttributeTableBuilder()CREATETABLE();
                }
return _customAttributes;
}
}
}
public AttributeTable AttributeTable
{
get {
if (_customAttributes == null)
{
_customAttributes = new AttributeTableBuilder().CreateTable();
}
return _customAttributes;
}
}
}
}
}
命名空间SilverlightControl.Expression.Design
{
公共类CustomMetadataBuilder:AttributeTableBuilder
{
public CustomMetadataBuilder()
{
namespace SilverlightControl.Expression.Design
{
public class CustomMetadataBuilder : AttributeTableBuilder
{
public CustomMetadataBuilder()
{
AddMemberAttributes(typeof运算(myControl),QUOT; MyStringProperty",
AddMemberAttributes(typeof(myControl), "MyStringProperty",
             &NBSP ;         新DescriptionAttribute(QUOT;我是一个属性"),
new DescriptionAttribute("I am a property"),
                        新DisplayNameAttribute([我的String属性"),
new DisplayNameAttribute("My String Property"),
                        新的CategoryAttribute([我的类别"),
new CategoryAttribute("My Category"),
           &NBSP ;           新PropertyOrderAttribute(PropertyOrder.Early),
new PropertyOrderAttribute(PropertyOrder.Early),
                  &NB属;      PropertyValueEditor.CreateEditorAttribute(typeof(CustomDialogEditor)));
PropertyValueEditor.CreateEditorAttribute(typeof(CustomDialogEditor)));
}
}
private void AddTypeAttributes(Type type,params Attribute [] attribs)
{
base.AddCallback(type,builder => builder.AddCustomAttributes(attribs));
$
}
private void AddTypeAttributes(Type type, params Attribute[] attribs)
{
base.AddCallback(type, builder => builder.AddCustomAttributes(attribs));
}
private void AddMemberAttributes(Type type,string memberName,params Attribute [] attribs)
{
base.AddCallback(type,builder => builder.AddCustomAttributes(memberName,attribs));
$
}
} b $ b}
private void AddMemberAttributes(Type type, string memberName, params Attribute[] attribs)
{
base.AddCallback(type, builder => builder.AddCustomAttributes(memberName, attribs));
}
}
}
你能提供一些解决问题的方法。
Can you provide some deoms for solving the problem.
谢谢。
推荐答案
您好,
我很高兴 看到你的问题,类似的解决方案就是我在博客上发布的博客,这可能会帮助你做很多事情
Hello ,
I am glad to see your question, similar solution is what I have blogged on my blog and that might help you a lot in doing very stuff
这是我的博客,
http://www.expression-blend.com
我希望它帮助你!
问候,
这篇关于Blend4属性值可扩展性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!