This question is related to a question I posted some time ago (here).
I am using a ReactiveAsyncCommand
in the following way:
LoadTickets = new ReactiveAsyncCommand(null, 0, RxApp.DeferredScheduler);
LoadTickets.RegisterAsyncFunction(x => loadTickets())
.ToProperty(this, x => x.Tickets);
Observable.Interval(TimeSpan.FromSeconds(10), RxApp.DeferredScheduler)
.InvokeCommand(LoadTickets);
LoadTickets.Execute(null); //initial load
So, each 10 seconds I would like to call a command which will pipe the results of a function to a List.
However, after the initial Execute
, each subsequent time, the CanExecute
on the command is false. I checked that using:
Observable.Interval(TimeSpan.FromSeconds(10), RxApp.DeferredScheduler)
.Subscribe(_ =>
Debug.WriteLine("Can execute in timer " + LoadTickets.CanExecute(null))
);
Is there a reason why this is happening?