0

Possible Duplicate:
Automatically INotifyPropertyChanged
INotifyPropertyChanged and Auto-Properties

Currently I refactor an existing class in a WPF project to implement the INotifyPropertyChanged. The problem is that this class has around 150 members. So I have to write the following code for each members.

private string _member1;
...
public string Member1
{
    get { return _member1; }
    set { _member1 = value; OnPropertyChanged("Member1"); }
}

It's a tiring and dull job. Is there a convenient way to implement the INotifyPropertyChanged?

Community
  • 1
  • 1
user1012036
  • 163
  • 1
  • 9
  • I have googled this type of question but failed to get a satisfactory answer. I need a simple, compile-time solution or a free toolkit. Thanks for providing the links. – user1012036 Nov 01 '11 at 10:06
  • Try this http://code.google.com/p/notifypropertyweaver/ – Simon Nov 01 '11 at 10:54

1 Answers1

4

There`s a nice MSBuild task that does all that work for you - Kind of Magic. All you have to do is to add [Magic] attribute to a class and all of it`s properies will implement change notification.

icebat
  • 4,696
  • 4
  • 22
  • 36