MVVM light toolkit for WPF and Silverlight

To make development of WPF and Silverlight applications according to the Model-View-ViewModel pattern easier, I have put together a small toolkit which should speed up the creation of such applications by automating certain tasks.

Update: An automated Setup for the WPF and Silverlight MVVM Light Toolkit is available. Please use the automated Setup from now on. If you are unable to use the automated setup for any reason, please contact me at laurent@galasoft.ch. More information about the Setup and getting started with the MVVM Light Toolkit is available on the Get Started page.

Feedback

I am as always very interested in feedback, so do not hesitate to post a comment here, or contact me to start a discussion.

To be completely honest, I do not intend to add a lot of features to the toolkit. First, I am intrigued by new developments in Expression Blend 3 that I will keep under scrutiny, to see how they influence (or make obsolete) some of the features of this toolkit. Also, WPF 4 and Silverlight 3 will change the game of MVVM by (hopefully) integrating some of the concepts into the framework and making it an even more natural fit.

HOWEVER let’s keep the discussion rolling, so you know what to do if you like, dislike or want to change something in the toolkit ;)

Features

The community and Microsoft already have a few MVVM initiatives running. However, I didn’t find any completely satisfying for my particular set of requirements. Most importantly, I work as an integrator in WPF and Silverlight projects, and I use Expression Blend a lot. My toolkit is finely tuned to make working in Expression Blend much easier, for designers and developers. For instance, it allows creating design time data very easily, in order to facilitate design work. To be honest, I have been using some of the classes and concepts gathered here for quite some time already, but this is the first time that I have a clean, complete kit of features related to MVVM.

I spent a lot of time making the syntax and the features in the toolkit as compatible as possible between WPF and Silverlight. Most of the code can be shared between WPF and Silverlight. Minor changes are needed in XAML, but the ViewModels are compatible (as long as you don’t use WPF-only or Silverlight-only features of course).

Also included in the toolkit, you will find a Messenger making it super easy to enable communication between classes. Using the Messenger class and the classes in the GalaSoft.MvvmLight.Messaging namespace, you can broadcast messages to instances who registered for a particular type of message without worrying about dependencies or memory leaks.

Since it is a “light” toolkit, it should be quite easy for you to modify it to suit your own needs. Do not hesitate to inspire yourself from this code, or to modify it at will.

Manual Installation

Update: This is obsolete and has been removed. Please refer to the Get Started page for installing, and creating new MVVM Light applications.

Print | posted on Sunday, June 14, 2009 5:17 PM

Feedback

# re: MVVM ‘light’ toolkit for WPF and Silverlight

left by Erik at 6/14/2009 7:10 PM Gravatar
Wahoo! Thanks Laurent. I can't wait to take a look.

# re: MVVM ‘light’ toolkit for WPF and Silverlight

left by Thomas LEBRUN at 6/15/2009 1:39 AM Gravatar
Great Job Laurent !

I'll try it ASAP !

# re: MVVM ‘light’ toolkit for WPF and Silverlight

left by Rich Griffin at 6/15/2009 2:49 AM Gravatar
Nice work dude!

# re: MVVM light toolkit for WPF and Silverlight

left by Bernd at 6/16/2009 1:16 AM Gravatar
Thanks for sharing this, Laurent!

# re: MVVM light toolkit for WPF and Silverlight

left by David Roh at 6/16/2009 4:26 AM Gravatar
Awesome!

Thank you for sharing this Laurent!

The Expression Blend compatibility and design time data is especially appreciate - I use Blend and Visual Studio at the same time.

# re: MVVM light toolkit for WPF and Silverlight

left by Davide Zordan at 6/16/2009 5:34 AM Gravatar
Really cool Laurent, well done!

# re: MVVM light toolkit for WPF and Silverlight

left by Vito Arconzo at 6/16/2009 4:12 PM Gravatar
Nice work Laurent! ;)

# re: MVVM light toolkit for WPF and Silverlight

left by Frickel at 6/21/2009 3:49 PM Gravatar
Hello Laurent,

with upcoming Blend 3 please maintain the design time data creation :) I will try your toolkit when you have done the installer ;-)

# re: MVVM light toolkit for WPF and Silverlight

left by VB Reader at 9/25/2009 3:29 AM Gravatar
I have to say, this is one of the best article on WPF. I had spent lots of time reading online articles on UserControl creation and usage.

thanks

# re: MVVM light toolkit for WPF and Silverlight

left by Laurent at 2/4/2010 5:12 AM Gravatar
I didn't. Stay tuned, I will write a short article about that this weekend.

In the mean time, here is a short description: In Blend, bind the UserControl's DataContext to the Locator's ViewModel property. Do your design work. Then reset the DataContext property and run your application.

HTH,
Laurent
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: