コード例 #1
0
        public override async Task ExecuteAsync(object _)
        {
            _cancelCommand.NotifyCommandStarting();
            Execution = new NotifyTaskCompletion(_command(_cancelCommand.Token));
            OnPropertyChanged(nameof(Execution));
            RaiseCanExecuteChanged();
            await Execution.TaskCompletion;

            _cancelCommand.NotifyCommandFinished();
            RaiseCanExecuteChanged();
        }
コード例 #2
0
        public override async Task ExecuteAsync(object parameter)
        {
            _cancelCommand.NotifyCommandStarting();
            Execution = new NotifyTaskCompletion <TResult>(_command(_cancelCommand.Token));
            OnPropertyChanged("Execution");
            RaiseCanExecuteChanged();
            await Execution.TaskCompletion;

            _cancelCommand.NotifyCommandFinished();
            RaiseCanExecuteChanged();
        }