-
-
Notifications
You must be signed in to change notification settings - Fork 4
ReSharper NPP Template
Marc Rousavy edited this page Aug 21, 2018
·
3 revisions
If you are not using ReSharper, you can also download the
inpcp
snippet and import it in Tools > Code Snippets Manager (See Create a Code Snippet π)
Create a custom template
npp
forINotifyPropertyChanged
properties.
- Go to ReSharper > Tools > Templates Explorer..
- Switch to C# on the left side
- Click New Template in the top menu bar
- Use the following code:
private $TYPE$ $FIELDNAME$;
public $TYPE$ $PROPERTY$
{
get => $FIELDNAME$;
set => Set(ref $FIELDNAME$, value);
}
-
On the right side, set:
-
Shortcut:
npp
- Description: INotifyPropertyChanged Backed Field Property
- TYPE: Choose Macro
- FIELDNAME: Suggest name for a variable
- PROPERTY: Value of FIELDNAME with the first letter in upper case
-
Shortcut:
-
Save to apply
In any .cs
file you can write npp
to insert the template at the current position (needs to be a class inheriting ObservableObject
to work)
Result: