Skip to content

Instantly share code, notes, and snippets.

@tanaka-takayoshi
Created January 19, 2014 14:05
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 tanaka-takayoshi/8505439 to your computer and use it in GitHub Desktop.
Save tanaka-takayoshi/8505439 to your computer and use it in GitHub Desktop.
Code Snippet for MvxCommand of MvvmCross with VisualStudio.
<?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>Mvx Command</Title>
<Author>tanaka_733</Author>
<Description>Creates and initializes a new MvxCommand.</Description>
<HelpUrl></HelpUrl>
<Shortcut>xcommand</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal Editable="true">
<ID>BackingFieldName</ID>
<ToolTip>Backing Field name</ToolTip>
<Default>myCommand</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>CommandName</ID>
<ToolTip>Command name</ToolTip>
<Default>MyCommand</Default>
<Function>
</Function>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[private MvxCommand $BackingFieldName$;
public MvxCommand $CommandName$
{
get
{
return $BackingFieldName$
?? ($BackingFieldName$ = new MvxCommand(Execute$CommandName$));
}
}
private void Execute$CommandName$()
{
$end$
}]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment