Skip to content

Instantly share code, notes, and snippets.

@olexale
Created October 28, 2013 13:44
Show Gist options
  • Save olexale/7197027 to your computer and use it in GitHub Desktop.
Save olexale/7197027 to your computer and use it in GitHub Desktop.
MvvmCross snippets for Visual Studio
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>MvvmCross command</Title>
<Shortcut>cmvx</Shortcut>
<Description>Code snippet for MvvmCross command</Description>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>myCommand</ID>
<ToolTip>Private command name</ToolTip>
<Default>myCommand</Default>
</Literal>
<Literal>
<ID>MyCommand</ID>
<ToolTip>Public command name</ToolTip>
<Default>MyCommand</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[
MvxCommand _$myCommand$;
public System.Windows.Input.ICommand $MyCommand$ {
get {
_$myCommand$ = _$myCommand$ ?? new MvxCommand(Do$MyCommand$);
return _$myCommand$;
}
}
void Do$MyCommand$ ()
{
$end$
}
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>MvvmCross property</Title>
<Shortcut>pmvx</Shortcut>
<Description>Code snippet for MvvmCross proprty</Description>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>Type of the property</ToolTip>
<Default>string</Default>
</Literal>
<Literal>
<ID>privateName</ID>
<ToolTip>Private name</ToolTip>
<Default>privateProperty</Default>
</Literal>
<Literal>
<ID>publicName</ID>
<ToolTip>Public name</ToolTip>
<Default>PublicProprty</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[
$type$ _$privateName$;
public $type$ $publicName$ {
get { return _$privateName$; }
set { _$privateName$ = value; RaisePropertyChanged ("$publicName$"); }
}
$end$
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment