Which is the preferred MVVM framework for Xamarin development?

11,040

Traditional Xamarin.iOS / Xamarin.Android

There are many MVVM Frameworks available for Xamarin.iOS and Xamarin.Android development: MVVMCross, MvvmLight, PrismMVVM, ReactiveUI.

I've had the most success using ReactiveUI for MVVM and Splat for IoC.

The best feature about ReactiveUI is that it doesn't require any ViewModel Navigation. You may think that ViewModel-based Navigation is a good thing, but it can make your life much more difficult when implementing complex navigation patterns. iOS and Android have view-based navigation built-in, and I recommend leveraging those instead of trying to re-create the wheel by using ViewModel-based navigation.

Xamarin.Forms

You mentioned in the comments that you're not using Xamarin.Forms, but I wanted to include this in case another developer has a similar question for Xamarin.Forms.

Don't use an MVVM Framework with Xamarin.Forms.

Xamarin.Forms has a binding engine included. I've seen many developers over-complicate their Xamarin.Forms projects by implementing heavy frameworks like MVVMCross into Xamarin.Forms without receiving much benefit.

Xamarin.Forms doesn't include an IoC container, and you may want to add one to your project: TinyIoC, Autofac, Ninject, Splat.

I have had the most success using Splat.

Share:
11,040
DevMonk
Author by

DevMonk

Updated on June 19, 2022

Comments

  • DevMonk
    DevMonk almost 2 years

    Which is the preferred MVVM framework for Xamarin cross platform development? Any suggestions from experience will be helpful.

    thanks!