But going forward, we know we want to skin it with skin that has same three states.

So we force the skin state to mirror the host state with three simple steps: then we get a perfect state mirror (aka skin state = host component state).

Models are appropriate for capturing the domain logic, such as performing calculations or other manipulations. When an item is added to the shopping cart model, the new total for all of the items in the cart will be calculated.

The new total will then be stored on the model for access by other classes within the application.

By placing this logic within your models, you ensure that it isn’t scattered across the entire application and know exactly where to look to see how and when your data is being manipulated.

In addition to controlling access to data, models maintain the state of your application.

First, the developer creates a pair of properties on the view, one of which is a Bindable Property, and the other of which is a property of whatever type is required.

In the code below, stands in for what would typically be a user interface object in production code.

The other classes in your application will make requests of models via this API.

When data on the model is updated, the model dispatches events that the other classes within your application can react to.

The Bindable Object class provides a data storage mechanism that enables the application developer to synchronize data between objects in response to changes, for example, between the View and View Model in the MVVM design pattern. Forms namespace inherit from Bindable Object class, so they can all be used to bind the data behind their user interface elements to View Models that are supplied by the application developer.

To bind the data behind a property in a Bindable Object, typically a view, to a property in the View Model, application developers should do the following.

This is done by calling Register and storing the return value as a member of the class.