Xamarin MVVMCross Alternatives

2019-03-28 18:42发布

问题:

At the moment our company is using the Xamarin framework to create apps for Android and IOS.

We looked at MVVMCross for even more reusable code across the platforms. however the creating of platform specific views bothered us and we wanted to go further and created a shared xml file where we define the view for all platforms wherever that was possible.

These xml files are constructed like a XAML file which we then implement on the different platforms. for example

 <MapControl Width="100" /> 

converts to a MKMapView in IOS and a com.google.android.gms.maps.MapFragment on Android (just to give a rough example)

Anyway, my question is if anyone knows any opensource frameworks/ projects that implement a similar structure as stated above.

Perhaps this is even on the road map for MVVMCross?

回答1:

Within MVVMCross, there's the concept of "Plugins".

https://github.com/MvvmCross/MvvmCross/wiki/MvvmCross-plugins

These plugins implement the native equivalent of whatever you're trying to use(Maps, Location, File, etc)

Many of these are made by the community or people who need certain implementations made for a project.

As for another solution, there is ReactiveUI which is another MVVM framework built on top of Xamarin as well(But not limited to)

https://github.com/reactiveui/ReactiveUI

Hope that helps!



回答2:

Now Xamarin has introduced what is called "the Xamarin Forms" that you define the UI once and it will implement native UIs on different plat forms based on that xml form.