Prism Templates

Prism for the Windows Runtime provides two libraries that help developers create managed Windows Store apps:
  • The Microsoft.Practices.Prism.StoreApps library provides support for bootstrapping MVVM apps, state management, validation of user input, navigation, data binding, commands, and settings.
  • The Microsoft.Practices.Prism.PubSubEvents Portable Class Library allows communication between loosely coupled components in an app, thus helping to reduce dependencies between assemblies in a Visual Studio solution.
Together the libraries accelerate development of apps by providing support for MVVM, loosely coupled communication, and the core services required in Windows Store apps. For more info about Prism for the Windows Runtime see  Developing a Windows Store business app using C#, XAML, and Prism for the Windows Runtime and the Prism for the Windows Runtime codeplex site.

In order to make consuming Prism for the Windows Runtime easier I've created a set of Visual Studio project and item templates. Please note that the templates are not a patterns & practices release. They've been created in my spare time, and if you have any issues with them, or suggestions for future developments, you should report them to me through the Contact page on my blog.

Prism for the Windows Runtime Templates for Windows 8.1


The templates work with any edition of Visual Studio 2013 that you can use to create Windows Store apps, from Visual Studio Express for Windows 8, through to Visual Studio Ultimate Edition.
Download Prism Templates
The project templates allow you to create two types of app:
  1. Prism App: a single-page project for a Windows Store app that uses Prism for the Windows Runtime for Windows 8.1.
  2. Prism App using Unity: a single-page project for a Windows Store app that uses Prism for the Windows Runtime for Windows 8.1, and the Unity dependency injection container.

Each project template creates a Windows Store app project that includes a reference to the Prism.StoreApps library, a view (MainPage), a corresponding view model (MainPageViewModel), and an App class that bootstraps the app using the Prism.StoreApps library. In addition, the Prism App using Unity project template creates a Windows Store app project that also includes a reference to the Unity library, and bootstraps the app using the Unity dependency injection container.

The item templates allow you to add the following items to a Prism app:
  1. Page View (Prism): A minimal page view with a title and a back button control, for a Prism app.
  2. View Model (Prism): A view model class for a Prism app.
  3. Model (Prism): A model class, with validation support, for a Prism app.
  4. PubSubEvent (Prism): A loosely coupled event for a Prism app.
  5. UserControl View (Prism): A blank UserControl view for a Prism app.

Each item template creates a class that derives from the correct type in the Prism.StoreApps library. In addition, the PubSubEvent (Prism) item template adds a reference to the Prism.PubSubEvents library to the project. Please note that these item templates will only work with an app created from one of the Prism app project templates.

Prism for the Windows Runtime Templates for Windows 8.0


The templates work with any edition of Visual Studio 2012 and Visual Studio 2013 that you can use to create Windows Store apps, from Visual Studio Express for Windows 8, through to Visual Studio Ultimate Edition.
Download Prism Templates
The project templates allow you to create two types of app:
  1. Prism App: a single-page project for a Windows Store app that uses Prism for the Windows Runtime.
  2. Prism App using Unity: a single-page project for a Windows Store app that uses Prism for the Windows Runtime and the Unity dependency injection container. 
 
Each project template creates a Windows Store app project that includes a reference to the Prism.StoreApps library, a view (MainPage), a corresponding view model (MainPageViewModel), and an App class that bootstraps the app using the Prism.StoreApps library. In addition, the Prism App using Unity project template creates a Windows Store app project that also includes a reference to the Unity library, and bootstraps the app using the Unity dependency injection container.

The item templates allow you to add the following items to a Prism app:
  1. Page View (Prism): A minimal page view with layout awareness, a title, and a back button control, for a Prism app.
  2. View Model (Prism): A view model class for a Prism app.
  3. Model (Prism): A model class, with validation support, for a Prism app.
  4. PubSubEvent (Prism): A loosely coupled event for a Prism app.
  5. Flyout View (Prism): A Flyout view for a Prism app.
  6. Flyout View Model (Prism): A Flyout view model class for a Prism app.
  7. UserControl View (Prism): A blank UserControl view for a Prism app.
  8. Search Contract (Prism): A Prism app contract that supports displaying search results.
 
Each item template creates a class that derives from the correct type in the Prism.StoreApps library. In addition, the PubSubEvent (Prism) item template adds a reference to the Prism.PubSubEvents library to the project. Please note that these item templates will only work with an app created from one of the Prism app project templates.

The Search Contract (Prism) item template performs three actions:
  1. It adds a SearchResults page to the project.
  2. It adds the OnSearchApplication method override to the App class.
  3. It adds the Search declaration to the package manifest.