Skip to content

Instantly share code, notes, and snippets.

@Taka414
Created Aug 16, 2021
Embed
What would you like to do?
<?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