A snippet for Properties in a ViewModel

If you are using MVVM you probably should create a snippet very similar to the following to save time.

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC#\Snippets\1033\Visual C#\propvm.snippet

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
	<CodeSnippet Format="1.0.0">
			<Description>Code snippet for property and backing field for a ViewModel that calls NotifyPropertyChanged.</Description>
			<Author>Jared Barneck</Author>
					<ToolTip>Property type</ToolTip>
					<ToolTip>Property name</ToolTip>
			<Code Language="csharp"><![CDATA[public $type$ $property$
		get { return _$property$;}
			_$property$ = value;
	} private $type$ _$property$;

Leave a Reply

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

  1. Pingback: view it

  2. Pingback: WPF MVVM Tutorial | Rhyous