Skip to content

Instantly share code, notes, and snippets.

@kei10in
Forked from andersonimes/gist:2490459
Last active April 1, 2016 13:20
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 kei10in/9266ddb43d1c239b16c0c5897cda8f05 to your computer and use it in GitHub Desktop.
Save kei10in/9266ddb43d1c239b16c0c5897cda8f05 to your computer and use it in GitHub Desktop.
Property Code Snippet for ReactiveUI
<?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>ReactiveUI Property</Title>
<Author>Anderson Imes</Author>
<Description>Creates a property that calls RaiseAndSetIfChanged</Description>
<HelpUrl>
</HelpUrl>
<Shortcut>propr</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal Editable="true">
<ID>type</ID>
<ToolTip>Type of object in the collection to iterate through</ToolTip>
<Default>var</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>_propname</ID>
<ToolTip>Name of the property in camelCase</ToolTip>
<Default>name</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>propname</ID>
<ToolTip>Name of the property in PascalCase</ToolTip>
<Default>Name</Default>
<Function>
</Function>
</Literal>
</Declarations>
<Code Language="csharp" Delimiter="$"><![CDATA[private $type$ _$_propname$;
public $type$ $propname$
{
get { return _$_propname$; }
set { this.RaiseAndSetIfChanged(ref _$_propname$, value); }
}]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment