1[Category("MyCategory")]

属性分组,让设计师能在“属性的海洋”中快速找到自己需要的属性

 

Silverlight设计时特性的使用

 

2[EditorBrowsable(EditorBrowsableState.Advanced)]

属性隐藏,把不常用的属性放在隐藏面板中,在需要时才展开面板

 

Silverlight设计时特性的使用

 

3[Description("This is a number of clicking.")]

属性描述,提示设计师该属性的作用和注意事项

 

Silverlight设计时特性的使用

4[AlternateContentProperty]

控件内容,在对象树中,提供UI元素插入的功能

 

Silverlight设计时特性的使用

 

5Style Template类型的属性

在菜单栏中自动生成“该属型的编辑菜单”

例:

public Style InnerRectStyle

{

    get { return (Style)GetValue(InnerRectStyleProperty); }

    set { SetValue(InnerRectStyleProperty, value); }

}

 

public static readonly DependencyProperty InnerRectStyleProperty =

    DependencyProperty.Register("InnerRectStyle", typeof(Style), typeof(MyButton), new PropertyMetadata(null));

 

 

Silverlight设计时特性的使用

 

 

相关文章:

  • 2022-02-21
  • 2021-08-29
  • 2021-12-11
  • 2021-10-19
  • 2022-12-23
  • 2021-12-23
  • 2021-11-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
  • 2021-06-30
  • 2022-02-04
相关资源
相似解决方案