I have two simple Run/Cancel commands
Run = ReactiveCommand.CreateAsyncTask(x => RunImpl());
Run.ThrownExceptions.Subscribe(ex => UserError.Throw(ex.Message, ex));
Cancel = this.WhenAnyObservable(x => x.Run.IsExecuting).ToCommand();
Run.TakeUntil(Cancel);
Should I expect a cancellation token signaled into my async method when Cancel is executed?
private async Task<bool> RunImpl(CancellationToken cancellationToken = default(CancellationToken))
{
//some stuffs
if (cancellationToken.IsCancellationRequested)
return;
//next stuffs
}
If it´s so, what I'm doing wrong? Because IsCancellationRequest never goes true.
Thanks in advance.