This project has moved and is read-only. For the latest updates, please go here.

Code generator for MVVMLight (VB and C#)

Apr 24, 2010 at 10:13 AM
Edited Jul 11, 2010 at 10:52 PM

I've just finished a code generator (VB and C#) utiizing T4 templates and the awesome T4Toolbox for generating view models and views for MVVMLight @LBugnion

Download here:

It will generate views, viewmodels, and the "snippet" needed for the ViewModelLocator in the VB.NET and C# languages.

Generation can be a UserControl, Window, or a Page.

I've included a sample app too, showing the following patterns/methods:

  • Using NavigationMessage to enable/disable items, for navigation, and to close the main window.
  • Using MEF to get our list of pages in the sample app.



Apr 25, 2010 at 12:08 PM

Interesting, thanks for sharing!


May 1, 2010 at 12:31 AM

I've updated the download above. Here's the changes:

  • Added C# generation
  • Cut the templates I used in half!
  • Converted the events to use the messenger class, for navigation and window closing.




May 26, 2010 at 12:21 AM

The templates were upgraded again, with bug fixes. The link in the top post is the download.

Jul 9, 2010 at 1:02 PM

How does one "install" these, maybe incldue a readme.txt :)




Jul 11, 2010 at 8:36 PM
Edited Jul 11, 2010 at 10:51 PM

In your project, create a "CodeTemplates" folder and stick the "MVVMGen" folder in there. Then open the file, edit it and click save. Watch the magic happen!

UPDATE: I have updated the link above. It includes a sample app with usage.