40 lines
1.2 KiB
Plaintext
40 lines
1.2 KiB
Plaintext
<?xml version="1.0" encoding="utf-8"?>
|
|
<CodeSnippets
|
|
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
|
|
<CodeSnippet Format="1.0.0">
|
|
<Header>
|
|
<Title>Prism DelegateCommand</Title>
|
|
<Shortcut>cmda</Shortcut>
|
|
<Author>Brian Lagunas</Author>
|
|
<Description>Creates a DelegateCommand property with an Execute method</Description>
|
|
<SnippetTypes>
|
|
<SnippetType>Expansion</SnippetType>
|
|
</SnippetTypes>
|
|
</Header>
|
|
<Snippet>
|
|
<Declarations>
|
|
|
|
<Literal>
|
|
<ID>CommandName</ID>
|
|
<ToolTip>Name of the DelegateCommand</ToolTip>
|
|
<Default>CommandName</Default>
|
|
</Literal>
|
|
</Declarations>
|
|
<Code Language="csharp">
|
|
<![CDATA[private AsyncDelegateCommand _$CommandName$;
|
|
public AsyncDelegateCommand $CommandName$ =>
|
|
_$CommandName$ ??= new AsyncDelegateCommand(Execute$CommandName$Async);
|
|
|
|
private async Task Execute$CommandName$Async()
|
|
{
|
|
await Task.Run(() =>
|
|
{
|
|
|
|
});
|
|
$end$
|
|
}]]>
|
|
</Code>
|
|
</Snippet>
|
|
</CodeSnippet>
|
|
</CodeSnippets>
|