More of a usability question. I'm building a big MVVM application, and I find myself copying / modifying this piece of code all over the place:
public NodeKind Kind
{
get { return (NodeKind)this.GetValue(KindProperty); }
set { this.SetValue(KindProperty, value); }
}
public static readonly DependencyProperty KindProperty = DependencyProperty.Register(
"Kind", typeof(NodeKind), typeof(DashboardNode));
Is there a way in Visual Studio to generate this code with a shortcut or something? I have Resharper and VS 2015, and I can't find the command that would automatically do that for me.
If you use ReSharper the dependencyProperty
snippet is generating this. Without ReSharper the propdp
snippet is creating the same.
There's the propdp
snippet. Just type propdp
and press TAB twice. A similar snippet exists for attached properties as well: propa
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With