Awesome new Prism for Windows Runtime resource - Project and item templates!

One thing that is a little tedious when you are first getting started with Prism for Windows Runtime is setting up a new project and swapping out base classes on the App class and each Page that you create, and cleaning up all the boilerplate code that Visual Studio puts in place. The good news is, you no longer have to, thanks to David Britch (who also wrote all the docs for Prism for Windows Runtime).

You can get the goods for what I am describing in this post here.

Using the Prism for Windows Runtime templates, you can now just do a File > New Project, and select a Prism App from the Windows Store category. You can choose from the Prism App, which uses manual dependency injection to pass client service references to the view model in the App.OnInitialize method, or Prism App using Unity to have it use the Unity container for dependency injection.

5-24-2013 1-33-45 PM

Once you create the project, it will have the App class inheriting from Prism’s MvvmAppBase, and will have one Page view and corresponding ViewModel, placed in the \Views and \ViewModels subfolders (and child namespaces), following the default convention for Prism’s ViewModelLocator.

5-24-2013 1-39-35 PM

Then to add new Views or ViewModels, you just right click on the respective folder and select Add > New Item, and you will see a number of Prism templates in the Windows Store category.

5-24-2013 1-42-19 PM

Nice big productivity boost compared to swapping out the base class in the code behind and XAML of your views and App class manually every time.

If you want a good end to end training on using Prism for Windows Runtime in your Windows Store apps, please be sure to check out my Pluralsight course Building Windows Store Business Apps with Prism. If you are not a Pluralsight subscriber, you should be because it is the best training around for getting up to speed on new technologies, and the price is soooo worth it.But if you prefer a written introduction, check out my article series on Prism here: http://tinyurl.com/prismrtseries.

Thanks much to David Britch for taking the time to put these templates together. I know I will be using them from now on with my Prism projects.