Created
October 19, 2019 09:44
-
-
Save Y-Koji/8e38aa6f218183b541812399b6ebdfda to your computer and use it in GitHub Desktop.
INotifyPropertyChanged 実装時のプロパティ定義用VisualStudioスニペット
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>通知可能プロパティ</Title> | |
<Shortcut>pprop</Shortcut> | |
</Header> | |
<Snippet> | |
<Code Language="CSharp"> | |
<![CDATA[ | |
private $Type$ _$Name$ { get; set; } = $Value$; | |
public $Type$ $Name$ { get => _$Name$; set { _$Name$ = value; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof($Name$))); } } | |
]]> | |
</Code> | |
<Declarations> | |
<Literal> | |
<ID>Type</ID> | |
<ToolTip>Property type.</ToolTip> | |
<Default>int</Default> | |
</Literal> | |
<Literal> | |
<ID>Name</ID> | |
<ToolTip>Property name.</ToolTip> | |
<Default>MyProperty</Default> | |
</Literal> | |
<Literal> | |
<ID>Value</ID> | |
<ToolTip>Default value.</ToolTip> | |
<Default>0</Default> | |
</Literal> | |
</Declarations> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment