WPF 依赖属性
public static readonly DependencyProperty CanCloseProperty =
DependencyProperty.Register("注册名称", typeof(类型), typeof(类名), new FrameworkPropertyMetadata(默认值,
new PropertyChangedCallback(值发生改变时要执行事件), new CoerceValueCallback(验证事件)));
必须public static 开头,
/// <summary>
/// 属性:关闭按钮是否可见
/// </summary>
[Category("Common")]
public bool CanClose
{
get { return (bool)GetValue(CanCloseProperty); }
set { SetValue(CanCloseProperty, value); }
}