实施 INotifyPropertyChanged - 是否存在不使用 AOP 的更好方法?

Implementing INotifyPropertyChanged - does a better way exist without using AOP?

我的问题是这个 question 的子问题。

作者提问:

Microsoft should have implemented something snappy for INotifyPropertyChanged, like in the automatic properties, just specify {get; set; notify;} I think it makes a lot of sense to do it. Or are there any complications to do it?

Can we ourselves implement something like 'notify' in our properties. Is there a graceful solution for implementing INotifyPropertyChanged in your class or the only way to do it is by raising the PropertyChanged event in each property.

If not can we write something to auto-generate the piece of code to raise PropertyChanged event?

我的问题是,有没有比以下更简单的事情我们可以做:

{get;set;notify;} ?

怎么样:

{get;set;} ?

有没有办法让它更隐含?我们的应用程序始终需要跟踪每个 属性 的更改。

没有代码生成,我只知道一种解决方案 - 使用 Castle Dynamic Proxy 和拦截器,如下所述:http://jonas.follesoe.no/oldblog/2009-12-23-automatic-inotifypropertychanged-using-dynamic-proxy/