我有一个名为Page的父对象,它有一个名为Control的对象列表:
public class Page
{
List<CustomControl> controls {get;set;}
}
Run Code Online (Sandbox Code Playgroud)
CustomControl类具有以下定义:
public class CustomControl
{
string Name {get;set;}
string Value {get;set;}
}
Run Code Online (Sandbox Code Playgroud)
比方说,Page类有两个CustomControls A和B.当Custom Control A的属性Value发生变化时,可以通知自定义控件B,以便它可以改变它的一些属性.
我正在考虑在CustomControl类上实现INotifyPropertyChanged事件,现在当同一个类的另一个实例具有其Modified的某个属性时,如何通知CustomControl的实例.