I was curious what was the best thing to do with ViewModels. Is it better to implement the interface INotifyPropertyChanged or to derive from ObservableObject.
ObservableObject class implements INotifyPropertyChanged and do some of the boring code like RaisePropertyChanged.
INotifyPropertyChanged require to implement PropertyChanged event.
From my point of view it seems more logical to use ObservableObject, but in most of the tutorial they implement INotifyPropertyChanged interface on their ViewModel.
Do you think it’s for the sake of simplicity or there’s a logical reason ?
ObservableObjectis part of Microsoft.Practices.Composite.Presentation – i.e. Prism. It’s also been implemented in MVVM Light and MVVM Foundation.INotifyPropertyChangedis part of System.ComponentModel – i.e. it’s in the core libraries.So, if you are not already including Prism or one of the other frameworks I’d stick with
INotifyPropertyChanged. There seems to be little point in including it just to get this one class.