This blog has, IMO, some great resources. Unfortunately, some of those resources are becoming less relevant. I'm still blogging, learning tech and helping others...please find me at my new home on

Tuesday, June 9, 2009

MVVM Code Generation

If you’re not already using the XAML Power Toys from Karl Shifflett, and you’re developing WPF/Silverlight apps with the MVVM pattern, well…get on it!

While he is a VB-er, he kindly makes his tools available to those of us on the dark side as well (those who develop in c#). Unfortunately there is a small issue with the code generation bits for the Create ViewModel For Class feature.

For all collection types the output is similar to the following:

private IEnumerable(Of QueueMember) _queueMember;

…instead of…

private IEnumerable<QueueMember> _queueMember;

This is a small cost for the significant benefits of this IDE enhancement and I wholly hope that, now that Karl is working for the mothership, that these features are carried into the new IDE.

Wouldn’t it be great to have a Pattern Extensions toolset, allowing for code-generation of stubs for various patterns? Of course, it would be extensible, so you could implement your own variations. Seems to me this is close already, with templates and snippets, just that it’s fractured. I routinely develop various bits working with Resharper, project templates and snippets to fill in the blanks, but an actual tool window and community support for all kinds of stub generation would be a great addition.

No comments:

Post a Comment