An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. ReactiveUI allows you to abstract mutable state away from your user interfaces, express the idea around a feature in one readable place and improve the testability of your application.
I've tried to implement the pattern on the message-bus page that observes commands from viewmodels in a ObservableList.
I have issues with getting this to work consistently on Android and iOS.
The example on this page doesn't work at all, as is, on either platform for me in a blank Xamarin Forms application.
It does however work on iOS if I set the outputscheduler of the DocumentViewModels Close command to RxApp.TaskpoolScheduler and set an ObserveOn(RxApp.MainThreadScheduler) before the Subscribe in the MainViewModel (see gist below).
On Android it works intermittently with these changes.
Here is a gist with the ViewModel and View that I've used when I tried to get it to work.
https://gist.github.com/nbloms/1f89ade2c7f321fa36dda84b8081ced8
I'm trying to execute the Close command of the first DocumentViewModel in the Clicked callback of a button. With my above changes the list of DocumentViewModels is emptied with 4 clicks on iOS and around 10 on Android. Without the changes nothing happens when I click the button.
I have tested both with simulator/emulator and on a physical device and I get the same behaviour regardless.
Would greatly appreciate if anyone would take their time to test the code from my gist and try to figure out what is happening.
Thanks!
Hi,
I've tried to implement the pattern on the message-bus page that observes commands from viewmodels in a ObservableList. I have issues with getting this to work consistently on Android and iOS.
The example on this page doesn't work at all, as is, on either platform for me in a blank Xamarin Forms application. It does however work on iOS if I set the outputscheduler of the DocumentViewModels Close command to RxApp.TaskpoolScheduler and set an ObserveOn(RxApp.MainThreadScheduler) before the Subscribe in the MainViewModel (see gist below).
On Android it works intermittently with these changes.
Here is a gist with the ViewModel and View that I've used when I tried to get it to work. https://gist.github.com/nbloms/1f89ade2c7f321fa36dda84b8081ced8 I'm trying to execute the Close command of the first DocumentViewModel in the Clicked callback of a button. With my above changes the list of DocumentViewModels is emptied with 4 clicks on iOS and around 10 on Android. Without the changes nothing happens when I click the button.
I have tested both with simulator/emulator and on a physical device and I get the same behaviour regardless.
Would greatly appreciate if anyone would take their time to test the code from my gist and try to figure out what is happening. Thanks!