Visual Studio设计时间属性工具栏编辑长度转换器 [英] Visual studio Design time Properties toolbar edit for a length converter

查看:99
本文介绍了Visual Studio设计时间属性工具栏编辑长度转换器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在wpf c#中构建一个新控件。我有以下依赖属性





I am building a new control in wpf c#. I have the following Dependency property


[TypeConverter(typeof(LengthConverter))]
[LocalizabilityAttribute(LocalizationCategory.None, Readability = Readability.Unreadable)]
[Description("Gets or sets the dropdown height when control is initiated")]
public Double DropDownHeight
{
    get { return (Double)this.GetValue(DropDownHeightProperty); }
    set { this.SetValue(DropDownHeightProperty, (object)value); }
}





它完全正常,我甚至可以使用自动作为属性,因为转换器。我的问题是



1)编辑器属性应该在Visual Studio 2012的属性工具栏中的属性旁边显示设置自动按钮功能?



2)是否有VS2012标配的所有编辑器属性的可用列表,因此您不必自己创建?



ps。我之前没有编译过编辑器属性或者在设计时关注外观,所以我对此的了解有些限制 - 任何帮助都会受到赞赏。



It works perfectly fine and I can even use "Auto" as property because of the converter. my question is

1) what should the editor attribute look like to have the "Set Auto" button function displayed next to the property in the Properties Toolbar in Visual studio 2012?

2) is there a available list of all the editor attributes that comes standard with VS2012, so you don't have to create your own?

ps. I haven't compiled an editor attribute before or cared much for the "look" at the design time before, so my knowledge on this is somewhat limited - any help will be appreciated.

推荐答案

你需要设计时汇编和自定义属性编辑器,比如这个。注意,它可能是耗时且复杂的,并且要正常工作,设计时程序集应该在注册表中注册。所以,如果没有它就可以生存,请保留
you'll need design-time assembly and custom property editor, something like this. Note, it might be time-consuming and complicated, and to work correctly, design-time assemblies should be registered in registry. So, if you can live without it, leave it


这篇关于Visual Studio设计时间属性工具栏编辑长度转换器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆