Closed mishun closed 1 year ago
This is actually working as intended. ReactiveUI doesn't automatically change back to UIThread. See here
https://github.com/reactiveui/ReactiveUI/blob/8951172879d944a983e22cbe640752f09091bbfc/src/ReactiveUI/ReactiveCommand/ReactiveCommand.cs#L653 Hmm, yes, it appears to do only CanExecute updates caused by started/stopped execution on scheduler.
I apologize for my stupid question, but what to do with already existing 3rd party ReactiveCommands? Can I specify in command binding that CanExecute needs to be brought on UI thread, or is there any existing adapter for ReactiveCommand?
Hi! Here's simple example program that has button that executes ReactiveCommand and CheckBox that should enable and disable button via ReactiveCommand.CanExecute:
When toggling CheckBox it fails with following message:
If canExecute.Trigger is called on same thread (commented variant) then it works as expected. Well, "Call from invalid thread" is actually true statement here, but from what I understand, one of the main points of using ReactiveUI is that it is supposed to handle such things automatically.