<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>ICommand property (mvvm)</Title>
<Shortcut>ic</Shortcut>
<Description>Code snippet for adding a new ICommand</Description>
<Author>Ralf de Kleine</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Imports>
<Import>
<Namespace>System.Windows.Input</Namespace>
</Import>
</Imports>
<References>
<Reference>
<Assembly>PresentationCore.dll</Assembly>
</Reference>
</References>
<Declarations>
<Literal>
<ID>fieldname</ID>
<ToolTip>Replace with the name of the test class</ToolTip>
<Default>_action</Default>
</Literal>
<Literal>
<ID>method</ID>
<ToolTip>Replace with the name of the test class</ToolTip>
<Default>Action</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[
private ICommand $fieldname$Command;
public ICommand $method$Command
{
get
{
return $fieldname$Command ?? ($fieldname$Command = new RelayCommand(p => $method$(p)));
}
}
public void $method$(object par)
{
}
]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>