Title says it all. Based on your experience, what's the key difference between both frameworks?. When we should use one over the other?.
Intended use: cross-platform development (Windows 8, iOS, Android, WindowsRT, Mac).
I use both MvvmCross and ReactiveUI, in the same cross-platform solution, for iOS, Android, and Windows.
I would say my solution is based on MvvmCross because the App class, how the app starts up, and ViewModel navigation are following MvvmCross' way. But I also use several of ReactiveUI's key features:
ReactiveCommand
I really like its auto disabling feature (CanExecute, IsExecuting) when it's bound to a button.
ReactiveList
and it's derived listThis is a class that I would like to recommend to anyone programming MVVM, it has solved almost all my pain points in ObservalbeCollection. The usage of CreateDerivedCollection
itself alone can be the whole reason that I include ReactiveUI in my project.
MessageBus
I'm afraid that I was spoiled by its auto marshaling to UI main thread. I don't need to worry if I'm in a task pool or UI thread, I just call SendMessage. (This is very different from MvvmLight's implementation and it's the main reason I left MvvmLight 2 years ago, sorry)
When I use the features above, I don't care if they're reactive or not, I just use them because they fit my needs very well. (In fact, ReactiveCommand
, ReactiveList
, and MessageBus
are all reactive)
Can I use ReactiveUI only? I also asked the question to myself. I guess I will miss something from MvvmCross:
I use several plugins from MvvmCross and I really want each plugin is compatible with both MvvmCross and ReactiveUI. ( Maybe they already are, I just didn't check because I'm already using MvvmCross to handle the plugins.)
There are a lot of tutorial on MvvmCross and Youtube videos. I just can't image how much effort is put on those kinds of things.
I learn Xamarin by MvvmCross, to be honest.
Sometimes I can't tell if a class is provided by MvvmCross or Xamarin if not for the Mvx
prefix. I checked my project, almost all the base classes of my UI code are MvxSomething (I don't use Xamarin.Forms). I don't know what exactly are provided by the Mvx version of the base classes, I just use them and they work.
I'm still learning both of the 2 frameworks, but I wish they can be merged one day.
But this isn't exclusive - ReactiveUI can be used with not-reactive code
Even further, you can use ReactiveUI alongside other MVVM frameworks, you don't need to commit to one or the other. Many methods in RxUI such as WhenAny
work on any object and determine at runtime how to best connect to them.
RxUI is definitely a Buffet Table (take what you want!), not a seven-course meal :) MvvmCross is certainly a great choice to base your app on, and it'd be awesome to have a team try out how they work together in the same app. Report back!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With