예제 #1
0
        public void Execute(object parameter)
        {
            _isTaskActive = true;
            ManualCanExecuteChanged?.Invoke(this, EventArgs.Empty);

            var task = _execute();

            task.ContinueWith(t =>
            {
                _isTaskActive = false;
                ManualCanExecuteChanged?.Invoke(this, EventArgs.Empty);
            });
        }
예제 #2
0
파일: Command.cs 프로젝트: brunnerh/dtdmvvm
 /// <summary>
 /// Raises the <see cref="CanExecuteChanged"/> event, this method should be called to make controls reevaluate the <see cref="CanExecute"/> method.
 /// </summary>
 public void RaiseCanExecuteChanged() => ManualCanExecuteChanged?.Invoke(this, null);