Skip to content

Instantly share code, notes, and snippets.

@LSViana
Last active September 15, 2018 15:52
Show Gist options
  • Save LSViana/f11713d4c2594e24bd092c1d9dd898b3 to your computer and use it in GitHub Desktop.
Save LSViana/f11713d4c2594e24bd092c1d9dd898b3 to your computer and use it in GitHub Desktop.
Bindable Property Creator Snippet
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>bindprop</Title>
<Shortcut>bindprop</Shortcut>
<Description>Code snippet for Creating a Bindable Property</Description>
<Author>Lucas Viana</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>propname</ID>
<ToolTip>Property Name</ToolTip>
<Default>Name</Default>
</Literal>
<Literal>
<ID>type</ID>
<ToolTip>Property Type</ToolTip>
<Default>object</Default>
</Literal>
<Literal Editable="false">
<ID>classname</ID>
<ToolTip>Current Class' Name</ToolTip>
<Function>ClassName()</Function>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[public static BindableProperty $propname$Property = BindableProperty.Create(
nameof($propname$),
typeof($type$),
typeof($classname$));
public $type$ $propname$
{
get => ($type$)GetValue($propname$Property);
set => SetValue($propname$Property, value);
}]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment