Looking at many examples for ReactiveUI
ReactiveCommands
, the code looks something like
Delete = ReactiveCommand.CreateAsyncObservable(x => DeleteImpl());
Delete.IsExecuting.ToProperty(this, x => x.IsDeleting, out _isDeleting);
Delete.ThrownExceptions.Subscribe(ex => this.Log().ErrorException("Something went wrong", ex));
I am attempting to use CreateAsyncTask
instead of CreateAsyncObservable
Delete = ReactiveCommand.CreateAsyncTask(x => DeleteImpl());
Delete.IsExecuting.ToProperty(this, x => x.IsDeleting, out _isDeleting);
Delete.ThrownExceptions.Subscribe(ex => this.Log().ErrorException("Something went wrong", ex));
The Delete command
is bound to a WPF button.
With the CreateAsyncObservable
, the button is enabled after recovery from the Error.
With the CreateAsyncTask
, the button is disabled.
Beyond using CreateAsyncObservable
(the logic is already written as async methods), how would I re-enable the button after the error?