ViewModels
The ViewModel is an object introduced by the Model View ViewModel (MVVM) pattern, a specific presentation pattern designed for WPF and Silverlight (and right now used also in Windows Phone 7). The core of this pattern is the Model for View, i.e., the ViewModel. We will analyze this and other concepts in more detail in the chapter dedicated to UI patterns for WPF, but right now let’s just identify this object as the ViewModel and create one for each View of the TimeTracker application.
So, what is the main purpose of a ViewModel object and what should it implement? The ViewModel should implement the INotifyPropertyChanged interface so it can be bound dynamically to a View. It should also provide a mechanism for validation, and it should ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access