如果我有以下布局:鼓泡INotifyPropertyChanged的和嵌套的属性
public class A : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public B { get; set; }
}
public class B { public C { get; set; } }
public class C { public D { get; set; } }
public class D { public E { get; set; } }
//... add n classes
public class Z
{
public int Property
{
set
{
if(PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("Property"));
}
}
}
什么是我通知时A.B.C.D.E ... Z.Property变化最彻底的方法?
当A中的任何内容发生变化时,我希望它被标记为“脏”,这样我可以告诉系统A需要保存。