Data Context Change Tracking

The dirty state of an entity is monitored by the data context. This is usually accomplished with change notifications, provided through the INotifyPropertyChanging.PropertyChanging and INotifyPropertyChanged.PropertyChanged events, raised in the property setters of the entity.

Combining the PropertyChanged and PropertyChanging events raising into every property setter can add up to a lot of plumbing code. Fortunately the Assign method, in the custom ViewModelBase class, used throughout this book, raises the events required for change tracking.

For more information on the property change notification, in relation to the ViewModelBase class, see Chapter 2.

For entities that do not implement INotifyPropertyChanging

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.