OK, Lots of confusion around this pattern. I am also trying to wrap my head around this pattern and wanted to present what I have learned so far as well as my favorite links on the subject. I’m also working on a sample program that is from start-to-finish.
Model View ViewModel is usually called:
- or just the plain ViewModel
- It is just an architectural pattern for Silverlight of WPF.
- It is designed to allow Designers to focus on the user experience instead of the business logic.
- It’s been around since 2005, but has just now taken off because of the success of WPF/Silverlight.
- UI Unit Testing
So what is it and why is it so scary for a beginner.
Model- A class file
View – Usually a user control
ViewModel – Another class file : Your user control will get its data from the ViewModel. Please see the image below:
Image taken from orbifold.net – please don’t sue me. =)
I am planning on creating an application that shows you how to build it from start/finish. If you can’t wait on mine, here is a silverlight MVVM app that contains a full project using the pattern. Stay tuned!
Articles for more information:
WPF Apps With The Model-View-ViewModel Design Pattern by Josh Smith.
Introduction to Model/View/ViewModel pattern for building WPF apps
Advanced MVVM Book (Cost $10 but was written by Josh Smith)
MVVM – It’s Not Kool-Aid*
Videos for more information about the pattern:
Hands-On Model-View-ViewModel (MVVM) for Silverlight and WPF –recommended to watch the one on SilverLight first.
MVVM, a WPF UI Design Pattern - Essential Edition
Libraries of classes useful when building applications based on the MVVM philosophy.
MVVM Light Toolkit