You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dzearing edited this page Oct 13, 2014
·
1 revision
Summary
The ViewModel class provides a base on which you can mix data in, listen for 'change' events on anything that declares it, and fire a single 'change' event when one or more things change. This allows listeners (TemplatedView subclasses) to re-evaluate their state.
Usage
In TemplatedView instances, the ViewModel class is used itself as the default view model. Calling the setData method automatically mixes in values and fires a change event if their values change, allowing the view to re-evaluate its view state.
Typically a ViewModel encapsulates the data contract for a view.