Reputation: 60811
My question is a sub-question of this question.
The author is asking:
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?
My question is, is there something we can do that is even simpler than:
{get;set;notify;}
?
How about just:
{get;set;} ?
Is there a way to make it more implicit? We have applications where changes to every property always need to be tracked.
Upvotes: 0
Views: 442
Reputation: 71
Without code generation i know only one solution - use Castle Dynamic Proxy and interceptor as described here: http://jonas.follesoe.no/oldblog/2009-12-23-automatic-inotifypropertychanged-using-dynamic-proxy/
Upvotes: 2