使用Expression Effect dll自定义WPF控件

时间:2014-11-17 16:03:42

标签: wpf vb.net

我已经设置了依赖项属性:

   Public Shared ReadOnly SourceImageColor00Property As DependencyProperty = DependencyProperty.Register("SourceImageColor00", GetType(ColorToneEffect), GetType(OPCWPFImageColor))

我的财产看起来像这样:

      <Description("Image Color to display"), _
Category("Color Properties")> _
Public Property SourceImageColor00() As ColorToneEffect
    Get
        Return DirectCast(Me.GetValue(SourceImageColor00Property), ColorToneEffect)
    End Get
    Set(ByVal value As ColorToneEffect)
        Me.SetValue(SourceImageColor00Property, value)
    End Set
End Property

问题是当我在设计模式中有控件实例时,属性名称显示为&#34; Color Tone&#34;而不是&#34; SourceImageColor00&#34;。

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

为property:

设置DisplayName属性
<Description("Image Color to display"), _
Category("Color Properties"), _
DisplayName("Color Tone")> _
Public Property SourceImageColor00() As ColorToneEffect
    Get
        Return DirectCast(Me.GetValue(SourceImageColor00Property), ColorToneEffect)
    End Get
    Set(ByVal value As ColorToneEffect)
        Me.SetValue(SourceImageColor00Property, value)
    End Set
End Property

http://msdn.microsoft.com/en-us/library/system.componentmodel.displaynameattribute(v=vs.110).aspx