Last active
November 4, 2017 05:58
-
-
Save chrisg32/680079b90ac159e09b7b6ea2aef1c893 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets | |
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Prism Property with backing field.</Title> | |
<Shortcut>prp</Shortcut> | |
<Author></Author> | |
<Description>Define a property with backing field</Description> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
</SnippetTypes> | |
</Header> | |
<Snippet> | |
<Declarations> | |
<Literal> | |
<ID>type</ID> | |
<ToolTip>Replace with the property type</ToolTip> | |
<Default>string</Default> | |
</Literal> | |
<Literal> | |
<ID>PropertyName</ID> | |
<ToolTip>Replace with the property name</ToolTip> | |
<Default>PropertyName</Default> | |
</Literal> | |
<Literal> | |
<ID>fieldName</ID> | |
<ToolTip>Replace with the field name</ToolTip> | |
<Default>fieldName</Default> | |
</Literal> | |
</Declarations> | |
<Code Language="csharp"> | |
<![CDATA[private $type$ _$fieldName$; | |
public $type$ $PropertyName$ | |
{ | |
get => _$fieldName$; | |
set => SetProperty(ref _$fieldName$, value); | |
}$end$]]> | |
</Code> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment