Skip to content

Instantly share code, notes, and snippets.

@moraismateus
Last active May 13, 2022 05:13
Show Gist options
  • Save moraismateus/b99ab5547d4a13a1350bff9b4b1320ab to your computer and use it in GitHub Desktop.
Save moraismateus/b99ab5547d4a13a1350bff9b4b1320ab to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>ICommand Implementation</Title>
<Description>Xamarin Forms Relay Command</Description>
<Author>Mateus Morais</Author>
<Shortcut>icomm</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal Editable="true">
<ID>PublicName</ID>
<ToolTip>Command Public Name</ToolTip>
<Default>PublicName</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>PrivateName</ID>
<ToolTip>Command Private Name</ToolTip>
<Default>PrivateName</Default>
<Function>
</Function>
</Literal>
</Declarations>
<Code Language="CSharp">
<![CDATA[
private ICommand _$PrivateName$Command;
public ICommand $PublicName$Command
{
get
{
return _$PrivateName$Command ?? (_$PrivateName$Command = new RelayCommand(x =>
{
}));
}
}]]>
</Code>
<Imports>
<Import>
<Namespace>System.Windows.Input</Namespace>
</Import>
</Imports>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment