David Khuu
David Khuu

Reputation: 967

Xamarin Forms : can Prism and ReactiveUI be used in the same project ? If so, is it a good idea?

I have been working on a mobile application for one week, for personal education and enhancement. I have some experience with WPF and MVVM, I have no experience with mobile development.

The idea is to make a cross platform application, while testing some coding philosophies :

I plan to use the following components :

The current structure of my Visual Studio is the following :

I managed the following :

One issue is that there are a few articles on the web, that do comparisons between Prism and ReactiveUI (google Prism vs ReactiveUI).

So the question is : Am I doing something wrong by using both at the same time ?

I have no problem for now, but will I run into one ? And even if I don't, does it make sense to use them both at the same time ?

Upvotes: 6

Views: 2395

Answers (2)

Shimmy Weitzhandler
Shimmy Weitzhandler

Reputation: 104692

I found this wonderful video by @Dan Seigel and @Rodney Littles, which is a walkthrough on how to use RxUI for the VM bits and Prism for the bootstrapping and structural stuff.

Its structure is outlined in the sample project's ReadMe.md:

Using ReactiveUI + Prism

  • Use Prism Navigation Paradigms + DI
  • Use ReactiveCommands
  • Use ReactiveObject for the ViewModel's base class

Borrowed Instagram UI for Xamarin.Forms from Adam Pedley

Uses the following ReactiveUI concepts

Upvotes: 3

Rodney Littles
Rodney Littles

Reputation: 564

So the question is : Am I doing something wrong by using both at the same time ?

There is no problem using Prism and ReactiveUI together. ReacitveUI is a set of extension methods, rather than an opinionated framework.

I have no problem for now, but will I run into one ?

You may run into issue with property changed events going back and forth between the two frameworks (probably less with Prism than other Mvvm frameworks), but that should be easily resolvable.

And even if I don't, does it make sense to use them both at the same time ?

I generally say that when choosing an Mvvm framework you choose the one you want base on it's feature set. If Prism has the majority of the features, and you just want to spice it up with some reactive programming, that is a good way to go.

Upvotes: 8

Related Questions