O'Reilly logo

Applied WPF 4 in Context by Raffaele Garofalo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required