Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In this chapter, I show you how to define and use the data that forms the core of a Metro application. To do this, I will be loosely following the view model pattern, which allows me to cleanly separate the data from the HTML that is used to present it to the user. This makes applications easier to write, test, and maintain.
You may already be familiar with models and view models from design patterns such as Model-View-Controller (MVC) and Model-View-View Controller (MVVC). I am not going to get into the details of these patterns in this book. There is a lot of good information about MVC and MVVC available, starting with Wikipedia, which has some very balanced and insightful descriptions.
I find the benefits of using a view model to be enormous and well worth considering for all but the simplest Metro projects, and I recommend you seriously consider following the same path. I am not a pattern zealot, and I firmly believe in taking the parts of patterns and techniques that solve real problems and adapting them to work in specific projects. To that end, you will find that I take a pretty liberal view of how a view model should be used.