ReactiveUI vs. MvvmCross
Asked Answered
P

3

17

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).

Pallbearer answered 10/7, 2013 at 9:21 Comment(0)
T
12

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:

  1. ReactiveCommand

I really like its auto disabling feature (CanExecute, IsExecuting) when it's bound to a button.

  1. ReactiveList and it's derived list

This 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.

  1. 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:

  1. MvvmCross Plugins.

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.)

  1. MvvmCross's tutorials

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.

  1. MvvmCross's integration with Xamarin

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.

Throe answered 4/4, 2017 at 5:10 Comment(2)
How do you bind command with ReactiveUI in MvvmCross? I know how to add command in view model, but don't know how to add binding in viewLogue
@Throe Do you have an example project that combines MvvmCross with ReactiveUI?Surat
M
11

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!

Monteux answered 11/7, 2013 at 0:24 Comment(0)
R
10

What's the key difference between both frameworks?

One is centred on the Reactive extensions, one is based on more conventional Mvvm coding.

But this isn't exclusive - ReactiveUI can be used with not-reactive code, and MvvmCross can be used with the reactive extensions.

When we should use one over the other?

They are both great frameworks (IMO).

The choice of whether to use a framework and which to use is down to you and your team really.

Radnorshire answered 10/7, 2013 at 11:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.