1

Closed

How about an "ObservableObject" class?

description

ObservableObject is basically just the part of ViewModelBase that implements INotifyPropertyChanged, but it's very convenient to have as a separate class (as in Josh Smith's MVVM Foundation) because view-models are not the only objects that need to implement INotifyPropertyChanged. For example, let's say you have a DataGrid that binds to a list of Person objects. If any of the properties in Person can change while the user is viewing the DataGrid, Person would need to implement INotifyPropertyChanged. (I realize that if Person is auto-generated using something like LinqToSql, it will probably already implement INotifyPropertyChanged, but there are cases where I need to make view-specific versions of entity model objects, say, because I need to include a command to support a button column in a DataGrid.)
Closed Oct 13 at 12:53 PM by lbugnion

comments