A PRISM Notifying Backing Property Snippet for Visual Studio
When writing View Models deriving from NotifyingObject in PRISM I find myself endlessly having to write public notifying properties backed by private fields. To save my fingers, here's a Visual Studio snippet I use:
_myProperty Private backing property name _myProperty MyProperty Public property name MyProperty
$MyProperty$); } }]]>
To use it:
- Copy and paste the xml into a new file.
- Save it as "PRISMNotifyingBackedProperty.snippet".
- In Visual Studio open the Code Snippet Manager (Tools -> Code Snippets Manager).
- Click the Import button and navigate to the file you saved.
- When it prompts you where to add the snippet, chose My Code Snippets, click Finish, then OK.
You can now type "propprism" into your code and hit Tab to insert the snippet.
Hope this helps.