Alright this is crazy, tell me what I am doing wrong here, I have the following code (it is supposed to toggle enable/disable a command every two seconds)
ISubject<bool> fileSystemOperationRunning = new Subject<bool>();
var xxx =
Observable.Interval(TimeSpan.FromSeconds(2.0)).Select(_ => true)
.Scan( (p, n) => !p)
..CombineLatest(fileSystemOperationRunning, (a, b) => a && !b)
.ObserveOn(RxApp.MainThreadScheduler);
xxx.Trace("TEST1");
var startTextAnalysis = ReactiveCommand.CreateAsyncTask(
xxx,
_ => RunTextAnalysis());
StartTextAnalysis = startTextAnalysis;
startTextAnalysis.IsExecuting.Subscribe(fileSystemOperationRunning);
fileSystemOperationRunning.OnNext(false);
Here is the trace output
TEST1 : True
TEST1 : False
TEST1 : True
TEST1 : False
TEST1 : True
But my Button stays disabled.
If I remove the following part, it works
..CombineLatest(fileSystemOperationRunning, (a, b) => a && !b)
Why ?