I'm trying to create a snippet for a C# Property with the method NotifyPropertyChanged()
.
The result of the snippet should be like this:
private int _myProperty;
public int MyProperty
{
get => _myProperty;
set
{
if (_myProperty == value) return;
_myProperty = value;
NotifyPropertyChanged(nameof(MyProperty));
}
}
How do I change the case of the first letter of _MyProperty
to be _myProperty
?
See below my current snippet:
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>Property type</ToolTip>
<Default>int</Default>
</Literal>
<Literal>
<ID>property</ID>
<ToolTip>Property name</ToolTip>
<Default>MyProperty</Default>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[private $type$ _$property$;
public $type$ $property$
{
get => _$property$;
set
{
if (_$property$==value) return;
_$property$ = value;
NotifyPropertyChanged(nameof($property$));
}
}
$end$]]>
</Code>
</Snippet>