C#12 short way to write MVVM command getter using lambda expression
This is a very simple way to shorten the typing procedure for MVVM ICommand getter (introduced with C#6.0). Lambda expressions are here shown for ICommand getter but it can be used with any other property. If you want need an example write a comment to this post and we will provide an example for you
public ICommand ShareValueCommand { get { return new RelayCommand(ShareValueMethod); } }
Short (new) way
public ICommand ShareValueCommand => new RelayCommand(ShareValueMethod);
Post a Comment
0 Comments
Thanks!