Although we will go deeper into patterns in the following chapters, we can complete the theoretical concepts related to data binding by introducing the ViewModel.
In this chapter's introduction, we dealt with two objects that were part of data binding in Silverlight. We will particularly focus on the object which binds View and Model.
Note
ViewModel can be defined as the binding object or communication channel between the interface and the data model.
A ViewModel object shows properties which act as datasource for an interface. When we associate a ViewModel object to an interface, we are indicating the interface where it can pick up the data that its controls are binding. In other words, we are establishing DataContext (as we saw previously).
When we define a ViewModel class, we are specifying a combination of public properties with the necessary information to feed the view. We will also find that the handlers of the events are generated when the user interacts with...