Skip to content

Instantly share code, notes, and snippets.

@icebeam7
Created May 16, 2022 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icebeam7/d05db6efbe330534d5a235623586b825 to your computer and use it in GitHub Desktop.
Save icebeam7/d05db6efbe330534d5a235623586b825 to your computer and use it in GitHub Desktop.
MVVM Property Snippet
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>MVVM Property</Title>
<Author>Luis</Author>
<Description>Creates a View Model Full Property.</Description>
<Shortcut>mvvmprop</Shortcut>
</Header>
<Snippet>
<Code Language="CSharp">
<![CDATA[private $type$ $field$;
public $type$ $property$
{
get { return $field$;}
set { SetProperty(ref $field$, value);}
}
$end$]]>
</Code>
<Declarations>
<Literal>
<ID>field</ID>
<ToolTip>Private field.</ToolTip>
<Default>myVar</Default>
</Literal>
<Literal>
<ID>property</ID>
<ToolTip>Public property.</ToolTip>
<Default>myProp</Default>
</Literal>
<Literal>
<ID>type</ID>
<ToolTip>Property type</ToolTip>
<Default>int</Default>
</Literal>
</Declarations>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment