Prism Library Quick Tip – Snippets

The Prism Template pack, available on Visual Studio Marketplace, offers a collection of helpful snippets to speed up your development. To use the snippets in Visual Studio, simply type the shortcut (e.g. propp) and press TAB.

Here is a quick list of each as a handy reference:

propp

Generate a property with a backing field, that depends on BindableBase. This means it will generate a standard property, but with a setter that uses the BindableBase SetProperty method, e.g.

cmd

Generates a DelegateCommand property, with backing field and the associated Execute method, e.g.

cmdfull

Generate a DelegateCommand property, with backing field as well as its associated Execute method. It also creates the CanExecute method for you, e.g.

cmdg

Similar to the cmd snippet mentioned above, but this one generates a generic DelegateCommand property

cmdgfull

Similar to the cmdfull snippet mentioned above, but this one generates a generic DelegateCommand property with its associated Execute and CanExecute Methods

These snippets are incredibly  handy when working with Prism as it really makes it easy to add the code elements essential for the framework to work smoothly.

To read more about the Prism Library, visit http://prismlibrary.com/

Thank you for reading. Until next time, keep coding!

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: