Thursday, March 14, 2013 [Tweets] [Favorites]

MVVM and View Models

Colin Wheeler:

In the MVVM pattern the View Model encapsulates data/properties that the view can bind to, any validation logic and actions that can be performed. For instance if you had a button that needs to change its title text you would have a property on the view model that the button can bind its title property to. The same goes if you need to change the color of a control or enable and disable the control. In this pattern we are essentially taking the state of our app and putting it into a view model.

Among other benefits, this decoupling makes it easier to test and revise the interface.

Comments

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment