Skip to content

Instantly share code, notes, and snippets.

@pictos
Created September 4, 2025 23:39
Show Gist options
  • Select an option

  • Save pictos/db36b289bed12fbb49897327c5d06977 to your computer and use it in GitHub Desktop.

Select an option

Save pictos/db36b289bed12fbb49897327c5d06977 to your computer and use it in GitHub Desktop.
BP.snippet
<?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>BindableProperty</Title>
<Author>
</Author>
<Description>
</Description>
<HelpUrl>
</HelpUrl>
<Shortcut>propbd</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal Editable="true">
<ID>PropertyName</ID>
<ToolTip>PropertyName</ToolTip>
<Default>PropertyName</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>PropertyType</ID>
<ToolTip>PropertyType</ToolTip>
<Default>PropertyType</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>DeclaringType</ID>
<ToolTip>DeclaringType</ToolTip>
<Default>DeclaringType</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>DefaultValue</ID>
<ToolTip>DefaultValue</ToolTip>
<Default>DefaultValue</Default>
<Function>
</Function>
</Literal>
</Declarations>
<Code Language="csharp" Delimiter="$"><![CDATA[public static readonly BindableProperty $PropertyName$Property =
BindableProperty.Create(nameof($PropertyName$), typeof($PropertyType$), typeof($DeclaringType$),$DefaultValue$);
public $PropertyType$ $PropertyName$
{
get => ($PropertyType$)GetValue($PropertyName$Property);
set => SetValue($PropertyName$Property, value);
}]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment