1

I've got a Model class exposed in an ObservableCollection desgined with a DataTemplate where the Model's proeprty bindings are handled.

When I implement the INotifyPropertyChanged interface in the Model class manually, the bound proeprty in the ObservableCollection doesn't change automtically, but only after re-rendering the collection.

When I inherit from ViewModelBase (an MVVM Light toolkit class) and use the RasiePropertyChanged method, the bound property changes automatically without refreshing the entire collection.

What does the ViewModelBase do except for implementing the INotifyPropertyChanged interface?

Giora Ron Genender
  • 797
  • 1
  • 11
  • 21

1 Answers1

9

Well ViewModelBase in MVVM Light Toolkit gives you some additional helpers like IsInDesignMode and MessengerInstance

along with implementing INotifyPropertyChanged

Now in a model if you just want to implement INotifyPropertyChanged instead of trying to do it yourself just derive from ObservableObject

ObservableObject is also from MVVM Light toolkit and it only does the INPC implementation without the trimmings making it perfect for Models.

If you look at the definition for ViewModelBase in Visual Studio it inherits ObservableObject itself

Viv
  • 17,170
  • 4
  • 51
  • 71