Last active
February 19, 2021 03:18
-
-
Save parth7676/b54883e14190e69557b64ee0f19fe5ce to your computer and use it in GitHub Desktop.
Bindable Property Snippet for Xamarin Forms.
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>bprop</Title> | |
<Author>Microsoft Corporation</Author> | |
<Description>Code snippet for an automatically implemented $name$Property | |
Language Version: C# 3.0 or higher</Description> | |
<HelpUrl> | |
</HelpUrl> | |
<Shortcut>bprop</Shortcut> | |
</Header> | |
<Snippet> | |
<Declarations> | |
<Literal Editable="true"> | |
<ID>name</ID> | |
<ToolTip>name</ToolTip> | |
<Default>name</Default> | |
<Function> | |
</Function> | |
</Literal> | |
<Literal Editable="true"> | |
<ID>owner</ID> | |
<ToolTip>owner</ToolTip> | |
<Default>Owner</Default> | |
<Function> | |
</Function> | |
</Literal> | |
<Literal Editable="true"> | |
<ID>type</ID> | |
<ToolTip>type</ToolTip> | |
<Default>Type</Default> | |
<Function> | |
</Function> | |
</Literal> | |
</Declarations> | |
<Code Language="csharp"><![CDATA[public static readonly BindableProperty $name$Property = BindableProperty.Create("$name$", typeof($type$), typeof($owner$),default($type$)); | |
public $type$ $name$ | |
{ | |
get { return ($type$)GetValue($name$Property); } | |
set { SetValue($name$Property, value); } | |
}$end$]]></Code> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great job :) I just did some modifications for it to be cleaner and enjoy new capabilities in new C# versions. You can see my fork here: https://gist.github.com/Juansero29/5c3b42be5ef26e6e1d61048863508efb