-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDP.snippet
99 lines (96 loc) · 3.08 KB
/
DP.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Better DP Declaration</Title>
<Description>Add a new DP</Description>
<Shortcut>DP</Shortcut>
</Header>
<Snippet>
<Code Language="CSharp">
<![CDATA[[DP]
public $Type$ $Name$
{
get => this.Get<$Type$>();
set => this.Set( value );
}]]>
</Code>
<Imports>
<Import>
<Namespace>BetterDP</Namespace>
</Import>
</Imports>
<Declarations>
<Literal>
<ID>Type</ID>
<ToolTip>DP Type</ToolTip>
<Default>bool</Default>
</Literal>
<Literal>
<ID>Name</ID>
<ToolTip>DP Name</ToolTip>
<Default>name</Default>
</Literal>
</Declarations>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.0.0">
<Header>
<Title>Better DP Initialization</Title>
<Description>Add static constructor calling DP.InitializeProperties</Description>
<Shortcut>DPI</Shortcut>
</Header>
<Snippet>
<Code Language="CSharp">
<![CDATA[static $classname$()
{
DP.InitializeProperties( typeof( $classname$ ) );
}]]>
</Code>
<Imports>
<Import>
<Namespace>BetterDP</Namespace>
</Import>
</Imports>
<Declarations>
<Literal Editable="false">
<ID>classname</ID>
<ToolTip>Class name</ToolTip>
<Function>ClassName()</Function>
<Default>ClassNamePlaceholder</Default>
</Literal>
</Declarations>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.0.0">
<Header>
<Title>Better DP OnPropertyChanged</Title>
<Description>Add overridden method OnPropertyChanged( DependencyPropertyChangedEventArgs e )</Description>
<Shortcut>DPC</Shortcut>
</Header>
<Snippet>
<Code Language="CSharp">
<![CDATA[protected override void OnPropertyChanged( DependencyPropertyChangedEventArgs e )
{
base.OnPropertyChanged( e );
if( e.Property.Name == nameof( this.$Name$ ) )
{
;
}
}]]>
</Code>
<Imports>
<Import>
<Namespace>BetterDP</Namespace>
</Import>
</Imports>
<Declarations>
<Literal>
<ID>Name</ID>
<ToolTip>DP Name</ToolTip>
<Default>name</Default>
</Literal>
</Declarations>
</Snippet>
</CodeSnippet>
</CodeSnippets>