Chapter 4. The ViewModel

In Chapter 3, we looked at the reasons for splitting model and view responsibilities and implementing a ViewModel to mediate between these layers.

Now we'll focus more closely on the responsibilities of the ViewModel, which is, arguably, the most important component of the MVVM pattern, as well as the least familiar. We will look at the overall structure of an application built around MVVM, including a deeper explanation of how each layer operates. Concentrating more fully on the ViewModel, we will examine its lifecycle—from construction to destruction. We will also see that the .NET Framework provides a number of interfaces and classes that can help us produce a rounded ViewModel with enduring utility. Finally, we'll look ...

Get Pro WPF and Silverlight MVVM: Effective Application Development with Model-View-ViewModel now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.