Created
April 14, 2020 04:21
-
-
Save zafe/ba9035b772ffa74823f6b9da0237fb72 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ViewModel : ViewModelBase | |
{ | |
public ICommand ChangeNameCommand { get; } | |
... | |
} | |
public class DelegateCommand : ICommand | |
{ | |
private readonly Action<object> _executeAction; | |
public DelegateCommand(Action<object> executeAction) | |
{ | |
_executeAction = executeAction; | |
} | |
public void Execute(object parameter) => _executeAction(parameter); | |
public bool CanExecute(object parameter) => true; | |
public event EventHandler CanExecuteChanged; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment