Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/305.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 检测NPC嵌套模型更改_C#_Wpf_Xaml_Inotifypropertychanged_Postsharp - Fatal编程技术网

C# 检测NPC嵌套模型更改

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集合的更改)?当我的模型变脏时,我需要得到

我有NPC类的层次结构(由PostSharp实现)

[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; }
}