0

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?

Community
  • 1
  • 1
sTodorov
  • 5,435
  • 5
  • 35
  • 55

1 Answers1

2

Ok,

Found it, something that I overlooked:

LoadTickets = new ReactiveAsyncCommand(null, 1, RxApp.DeferredScheduler);

I had set the maximumConcurrent to 0 which probably explains why the command's CanExecute was always false.

sTodorov
  • 5,435
  • 5
  • 35
  • 55