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