I am doing the following tutorial, to learn about the MVVM pattern in WPF. There's something I don't understand about the following seemingly partly given implementation of ICommand interface.
In the code below the _canExecute variable is used as a method and a variable. I was thinking it's some event of some kind, but ICommand already has an event to be implemented and it's not _canExecute.
So can someone help me as to what _canExecute is supposed to be?
1: #region ICommand Members
2:
3: public bool CanExecute(object parameter) {
4: return _canExecute == null ? true : _canExecute(parameter);
5: }
6:
7: public event EventHandler CanExecuteChanged {
8: add { CommandManager.RequerySuggested += value; }
9: remove { CommandManager.RequerySuggested -= value; }
10: }
11:
12: public void Execute(object parameter) {
13: _execute(parameter);
14: }
15:
16: #endregion