by Jon Sigfusson
10. February 2011 07:45
Whenever I start working on a new solution in Visual Studio 2010 there are usually one or two projects based on the default WPF Application project template. Since starting in WPF I have been trying to discover how to bring the MVVM pattern into my work. For some weeks I have started up new projects following the same pattern, and it occurred to me that I should work these patterns into a project template of my own. But others may benefit from this template and you can download it here.
Files downloaded from the Internet are sometimes blocked for security reasons. To remove this block on the downloaded ZIP you right-click the file and select Properties from the context menu. At the bottom you should be able to see a section with the title Security and a button with a text similar to Unblock. I am Danish and run with a Danish version of Windows, which is why I do not know the exact wording.
The contents and the structure of the template can be seen in figure 1.

It uses the classes RelayCommand and ViewModelBase from Josh Smith’s excellent article in MSDN Magazine.
The template is an example on how to bind the ViewModel to the View without using an IoC framework. It also contains an example of how you can implement dialogs in MVVM with only minimal code in the View.
In the future I hope to find the time to create templates with splash, progress dialogs and background processing.
More to come…
2da5b8cd-9fb8-4f76-a0db-cf4b99842cde|0|.0
Tags:
Programming