WPF의 MVVM 패턴에 대해 알아 보려면 다음 tutorial을 수행하고 있습니다. ICommand 인터페이스를 구현 한 것으로 보이는 부분에 대해서는 내가 이해하지 못하는 부분이 있습니다.ICommand 구현 질문
아래 코드에서 _canExecute 변수는 메서드 및 변수로 사용됩니다. 일종의 이벤트라고 생각했지만 ICommand에는 이미 구현할 이벤트가 있으며 _canExecute가 아닙니다.
그래서 _canExecute가 무엇이되어야하는지에 관해 누군가 나를 도울 수 있습니까?
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
켄트 (Kent) - 큰 문제는 아니지만 다음 사항을 참고하시기 바랍니다. http://meta.stackexchange.com/questions/5029 –