Xamarin MVVMCross 替代方案

编程入门 行业动态 更新时间:2024-10-26 22:23:26
本文介绍了Xamarin MVVMCross 替代方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

目前我们公司正在使用 Xamarin 框架为 Android 和 IOS 创建应用程序.

我们查看了 MVVMCross 以获得跨平台更多可重用的代码.然而,平台特定视图的创建困扰着我们,我们想更进一步,创建一个共享的 xml 文件,我们尽可能在其中定义所有平台的视图.

这些 xml 文件的构造类似于 XAML 文件,然后我们将在不同的平台上实施该文件.例如

转换为 IOS 中的 MKMapView 和 Android 上的 com.google.android.gms.maps.MapFragment(仅举一个粗略的例子)

无论如何,我的问题是是否有人知道实现上述类似结构的任何开源框架/项目.

也许这甚至在 MVVMCross 的路线图上?

解决方案

在 MVVMCross 中,有插件"的概念.

github/MvvmCross/MvvmCross/wiki/MvvmCross-plugins

这些插件实现了您尝试使用的任何内容(地图、位置、文件等)的本机等价物

其中许多是由社区或需要为项目进行某些实施的人制作的.

至于另一种解决方案,ReactiveUI 是另一个构建在 Xamarin 之上的 MVVM 框架(但不限于)

github/reactiveui/ReactiveUI

希望有帮助!

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?

解决方案

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

github/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)

github/reactiveui/ReactiveUI

Hope that helps!

更多推荐

Xamarin MVVMCross 替代方案

本文发布于:2023-07-30 14:18:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1250210.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:方案   Xamarin   MVVMCross

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!