Skip to content

Instantly share code, notes, and snippets.

@Taka414
Created August 16, 2021 07:54
Show Gist options
  • Save Taka414/e48a078564a536ab105891057ecad9a5 to your computer and use it in GitHub Desktop.
Save Taka414/e48a078564a536ab105891057ecad9a5 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>rx</Title>
<Shortcut>rx</Shortcut>
<Description>ReactiveProp</Description>
<Author></Author>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>valueType</ID>
<Default>int</Default>
<ToolTip>公開する変数の型で置き換えます。</ToolTip>
</Literal>
<Literal>
<ID>propName</ID>
<Default>Sample</Default>
<ToolTip>公開するプロパティの名前で置き換えます。</ToolTip>
</Literal>
<Literal>
<ID>fieldName</ID>
<Default>sample</Default>
<ToolTip>内部で使用する変数の名前で置き換えます。</ToolTip>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[public $valueType$ $propName$ { get => this.$fieldName$.Value; set => this.$fieldName$.Value = value; }
public IObservable<$valueType$> $propName$Changed => this.$fieldName$;
private readonly ReactiveProperty<$valueType$> $fieldName$ = new ReactiveProperty<$valueType$>();$end$]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment