C# 检测NPC嵌套模型更改
我有NPC类的层次结构(由PostSharp实现)C# 检测NPC嵌套模型更改,c#,wpf,xaml,inotifypropertychanged,postsharp,C#,Wpf,Xaml,Inotifypropertychanged,Postsharp,我有NPC类的层次结构(由PostSharp实现) [NotifyPropertyChanged] 甲级 { } [NotifyPropertyChanged] B类 { [儿童] 公共建议集合Childs{get;set;} } [NotifyPropertyChanged] C类 { [儿童] 公共属性A{get;set;} [儿童] 公共B属性B{get;set;} } 如何订阅C类的对象以检测任何嵌套对象的任何属性是否已更改(包括对Childs集合的更改)?当我的模型变脏时,我需要得到
[NotifyPropertyChanged]
甲级
{
}
[NotifyPropertyChanged]
B类
{
[儿童]
公共建议集合Childs{get;set;}
}
[NotifyPropertyChanged]
C类
{
[儿童]
公共属性A{get;set;}
[儿童]
公共B属性B{get;set;}
}
如何订阅C类的对象以检测任何嵌套对象的任何属性是否已更改(包括对Childs集合的更改)?当我的模型变脏时,我需要得到通知查看或者我会说,您缺少类上的
[Aggregatable]
-属性。查看或者我会说,您缺少[Aggregatable]
-类的属性。在目标站点无法访问或脱机时,引用链接最相关的部分比发布链接更好。在目标站点无法访问或脱机时,引用链接最相关的部分比发布链接更好。
[NotifyPropertyChanged]
class A
{
}
[NotifyPropertyChanged]
class B
{
[Child]
public AdvisableCollection<A> Childs { get;set; }
}
[NotifyPropertyChanged]
class C
{
[Child]
public A PropertyA { get; set; }
[Child]
public B PropertyB { get; set; }
}