Created
November 26, 2018 17:03
-
-
Save formix/dcf1f80d20e61a819992c83963754bd4 to your computer and use it in GitHub Desktop.
ViewModel property snippet for visual studio 2017
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> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
</SnippetTypes> | |
<Title>View Model Property</Title> | |
<Description> | |
Declares a property and member suitable for Viewmodel implementation. | |
</Description> | |
<HelpUrl> | |
</HelpUrl> | |
<Shortcut>propvm</Shortcut> | |
</Header> | |
<Snippet> | |
<Declarations> | |
<Literal Editable="true"> | |
<ID>propname</ID> | |
<ToolTip>Property Name</ToolTip> | |
<Default>Name</Default> | |
<Function> | |
</Function> | |
</Literal> | |
<Literal Editable="true"> | |
<ID>type</ID> | |
<ToolTip>Property type.</ToolTip> | |
<Default>Type</Default> | |
<Function> | |
</Function> | |
</Literal> | |
</Declarations> | |
<Code Language="csharp" Kind="type decl"><![CDATA[ | |
public $type$ $propname$ | |
{ | |
get => Get<$type$>(nameof($propname$)); | |
set => Set(nameof($propname$), value); | |
} | |
$end$]]></Code> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works with the ViewModelMase.cs class.