In my UI code I have a lot classes with the same basic skeleton:
- derives from INotifyPropertyChanged
contains the following code:
void NotifyPropertyChanged(String info) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(info)); } } public event PropertyChangedEventHandler PropertyChanged;
It seems like a perfect chance to factor into a class and to derive from that instead of INotifyPropertyChanged, but sadly C# doesn't support multiple inheritance so it's not really going to work. Any ideas on how to refactor this kind of code?