In MVVM Light V4, I am proposing a new RelayCommand snippet, making it easier to declare and initialize a RelayCommand. I came up with a syntax that allows having the RelayCommand and its initialization in one convenient location.
I am looking for feedback, so leave your comments below!!
RelayCommand This is the code created by the code snippet after expansion, for a simple RelayCommand.
private RelayCommand _testCommand;/// <summary>/// Gets the TestCommand./// </summary>public RelayCommand TestCommand{ get { return _testCommand ?? (_testCommand = new RelayCommand( () => { // Execute delegate throw new NotImplementedException(); }, () => { // CanExecute delegate throw new NotImplementedException(); })); }}RelayCommand<T>This is the code cr ...
Go to the complete details ...