Created
June 27, 2019 18:04
-
-
Save CheetahChrome/54d61381a2da6fe8dbeb3a3c69595f0b to your computer and use it in GitHub Desktop.
Visual Studio Snippet to Work on a VM to add a Notified Property
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> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
</SnippetTypes> | |
<Title>NotifiedProperty</Title> | |
<Author>William Wegerson</Author> | |
<Description>Same as the propfull snippet except it adds OnPropertyChanged to the setter. | |
</Description> | |
<HelpUrl> | |
</HelpUrl> | |
<Shortcut>propnot</Shortcut> | |
</Header> | |
<Snippet> | |
<Declarations> | |
<Literal Editable="true"> | |
<ID>Type</ID> | |
<ToolTip>Type</ToolTip> | |
<Default>Type</Default> | |
<Function> | |
</Function> | |
</Literal> | |
<Literal Editable="true"> | |
<ID>PropertyName</ID> | |
<ToolTip>PropertyName</ToolTip> | |
<Default>PropertyName</Default> | |
<Function> | |
</Function> | |
</Literal> | |
</Declarations> | |
<Code Language="csharp"> | |
<![CDATA[ | |
private $Type$ _$PropertyName$; | |
public $Type$ $PropertyName$ | |
{ | |
get { return _$PropertyName$; } | |
set { _$PropertyName$ = value; OnPropertyChanged("$PropertyName$"); } | |
}]]></Code> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Similar to Visual Studio's snippets of
prop
orpropfull
, this is my Visual Studio snippet which does the same aspropfull
except it adds notification in the set. Ex:I have always used these Control dependency property snippets Helpful Silverlight Snippets in all versions of XAML. But this is my personal one which can be used on the VM instead of a control.