1.首先必须是依赖属性 DependencyProperty
2.需要实现INotifyPropertyChanged接口
3.声明事件 event PropertyChangedEventHandler PropertyChanged;
4.编写方法
protected void RaisePropertyChanged(string propertyName)
{
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if ((propertyChanged != null))
{
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}