Project Description
The MVVM Toolkit is a pretty barebones template for MVVM and is a good place to start with if you are new to this pattern. Over time, as i played around with this toolkit, the library grew in size. Its been useful for me - so i thought i might as well share it out :) .. The code is an extension of the Toolkit and pulls in a lot of concepts\code from other fameworks out in the wild like Cinch, Prism... Will have a subsequent post on these frameworks. So getting back to this library, it includes support for:
  • Delegating Commands\Keybinding
  • Messaging between VM's
  • Handling events as commands with attached behaviors
  • Handling dialogs (and more) as services

A very simple sample is also included to show the various parts in action. (Nothing fancy)



To make the writing of commands with Attached behaviors you could use Damian's code snippet installer
Once you install, edit the snippet to include CommandParameter = e; at the beginning of the last function (On$EventType$) in the file. The file is placed under Documents\Visual Studio 2008(10)\Code Snippets\Visual C#\My Code Snippets. The shortcut for its usage in code is cmdbehavior

You would need to fill 4 parts in the snippet:
  • CommandAction - Descriptive name of what the command performs
  • BehaviorName - Attached behavior name (this hooks the event)
  • ControlType - Type of control to which the command will attach
  • EventName - Name of the control event that the behavior hooks up

As mentioned earlier the library several frameworks were used as references
  • Cinch - mainly for the Services and the necessary plumbing
  • Josh\Marlon's Mediator library
  • Prism
  • Mark's MVVM Helpers

Hopefully you'll find the library useful. Also, this library by no means covers all possible scenarios. Have fun coding.

Aside from MVVM, an interesting Test API library is TestAPI

Last edited Oct 27, 2009 at 12:17 AM by llester1878, version 8