Created
November 13, 2013 03:20
-
-
Save yoshikazuendo/7443149 to your computer and use it in GitHub Desktop.
Visual Studio 2008 C#のWPF依存関係プロパティのコードスニペットです。
Visual Studioでこのコードを登録すると、コードスニペットとして使用できます。
This file contains 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>propvm</Title> | |
<Shortcut>propvm</Shortcut> | |
<Description>WPFのViewModelで定義するプロパティのコード スニペット</Description> | |
<Author>Microsoft Corporation</Author> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
<SnippetType>SurroundsWith</SnippetType> | |
</SnippetTypes> | |
</Header> | |
<Snippet> | |
<Declarations> | |
<Literal> | |
<ID>type</ID> | |
<ToolTip>プロパティの種類</ToolTip> | |
<Default>string</Default> | |
</Literal> | |
<Literal> | |
<ID>privateProp</ID> | |
<ToolTip>プロパティ用のprivate変数名</ToolTip> | |
<Default>privateName</Default> | |
</Literal> | |
<Literal> | |
<ID>default</ID> | |
<ToolTip>プロパティのデフォルト値</ToolTip> | |
<Default>string.Empty</Default> | |
</Literal> | |
<Literal> | |
<ID>comment</ID> | |
<ToolTip>プロパティの説明</ToolTip> | |
<Default>プロパティの説明</Default> | |
</Literal> | |
<Literal> | |
<ID>publicProp</ID> | |
<ToolTip>プロパティ名</ToolTip> | |
<Default>PublicName</Default> | |
</Literal> | |
</Declarations> | |
<Code Language="csharp"><![CDATA[private $type$ $privateProp$ = $default$; | |
/// <summary> | |
/// $comment$を取得・設定します。 | |
/// </summary> | |
public $type$ $publicProp$ | |
{ | |
get { return this.$privateProp$; } | |
set | |
{ | |
if (this.$privateProp$ != value) { | |
this.$privateProp$ = value; | |
base.RaisePropertyChanged("$publicProp$"); | |
} | |
} | |
}$end$]]> | |
</Code> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment