-
Notifications
You must be signed in to change notification settings - Fork 0
/
inpc.snippet
36 lines (35 loc) · 1.2 KB
/
inpc.snippet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>INotifyPropertyChanged implementation</Title>
<Author>DepthRel</Author>
<Description>Call insert of OnPropertyChanged()</Description>
<Shortcut>inpc</Shortcut>
</Header>
<Snippet>
<Code Language="CSharp">
<![CDATA[public event PropertyChangedEventHandler PropertyChanged = delegate { };
protected virtual void $MethodName$([CallerMemberName] string propertyName = null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}$end$]]>
</Code>
<Declarations>
<Literal>
<ID>MethodName</ID>
<ToolTip>The name of method</ToolTip>
<Default>OnPropertyChanged</Default>
</Literal>
</Declarations>
<Imports>
<Import>
<Namespace>System.ComponentModel</Namespace>
</Import>
<Import>
<Namespace>System.Runtime.CompilerServices</Namespace>
</Import>
</Imports>
</Snippet>
</CodeSnippet>
</CodeSnippets>