Implementing INotifyPropertyChanged - does a better way exist?

前端 未结 30 2730
感情败类
感情败类 2020-11-21 05:23

Microsoft should have implemented something snappy for INotifyPropertyChanged, like in the automatic properties, just specify {get; set; notify;} I

30条回答
  •  时光取名叫无心
    2020-11-21 05:48

    A very AOP-like approach is to inject the INotifyPropertyChanged stuff onto an already instantiated object on the fly. You can do this with something like Castle DynamicProxy. Here is an article that explains the technique:

    Adding INotifyPropertyChanged to an existing object

提交回复
热议问题