Getting started with MVVM (General Info+Links)

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:

  • MVVM 
  • PresentationModel
  • or just the plain ViewModel
  1. It is just an architectural pattern for Silverlight of WPF.
  2. It is designed to allow Designers to focus on the user experience instead of the business logic
  3. It’s been around since 2005, but has just now taken off because of the success of WPF/Silverlight.
  4. 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

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 Foundation
MVVM Light Toolkit

This article is part of the GWB Archives. Original Author: mbcrump

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.