背景
17/03/28 追記:※ReactiveProperty3.6.0からこのコードスニペットが含まれます。
既存のReactiveProperty関連のコードスニペットとして
- ReactiveCollection
- ReactiveCommand
- ReactiveCommandGeneric
- ReactiveProperty
- ReadOnlyReactiveCollection
- ReadOnlyReactiveProperty
はありますが、AsyncReactiveCommandのスニペットは無かったので作りました。
なお、上記コードスニペットは
ReactivePropertyをnugetで取得するとついてきますが、
使用するためには手動でコードスニペットマネージャーに追加する必要があります。
コード
AsyncReactiveCommand.snippet
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Keywords>
        <Keyword>arcomm</Keyword>
      </Keywords>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>AsyncReactiveCommand</Title>
      <Author>soi</Author>
      <Description>AsyncReactiveCommand Non Generic</Description>
      <Shortcut>arcomm</Shortcut>
    </Header>
    <Snippet>
      <Declarations>
        <Literal Editable="true">
          <ID>CommandName</ID>
          <Default>CommandName</Default>
        </Literal>
      </Declarations>
      <Code Language="csharp"><![CDATA[public AsyncReactiveCommand $CommandName$ { get; }$end$]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>
AsyncReactiveCommandGeneric.snippet
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Keywords>
        <Keyword>arcommg</Keyword>
      </Keywords>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>AsyncReactiveCommandGeneric</Title>
      <Author>soi</Author>
      <Description>AsyncReactiveCommand Generic</Description>
      <Shortcut>arcommg</Shortcut>
    </Header>
    <Snippet>
      <Declarations>
        <Literal>
          <ID>T</ID>
          <Default>T</Default>
        </Literal>
        <Literal Editable="true">
          <ID>CommandName</ID>
          <Default>CommandName</Default>
        </Literal>
      </Declarations>
      <Code Language="csharp"><![CDATA[public AsyncReactiveCommand<$T$> $CommandName$ { get; }$end$]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>
使用方法
上記コードのファイルを作成して、
VisualStudioのコードスニペットマネージャーから追加できます。