[英]Is it possible to migrate a MonoCross application incrementally to MvvmCross?
The team I'm on created a cross-platform application that runs on iOS, Android, and Windows Mobile that was created using Xamarin's tools and MonoCross. 我所在的团队创建了一个跨平台的应用程序,该应用程序在iOS,Android和Windows Mobile上运行,使用Xamarin的工具和MonoCross创建。 We're looking at MvvmCross as a possible MonoCross replacement but don't want to write the application from scratch. 我们将MvvmCross视为可能的MonoCross替代品,但不想从头开始编写应用程序。
Does anyone have experience with or thoughts on migrating a Xamarin/MonoCross cross-platform application to Xamarin/MvvmCross? 有没有人有过将Xamarin / MonoCross跨平台应用程序迁移到Xamarin / MvvmCross的经验或想法? Is it possible for the two frameworks to coexist in the same app (the ideal solution would have us migrate the app one screen at a time). 这两个框架是否有可能在同一个应用程序中共存(理想的解决方案是让我们一次将应用程序迁移到一个屏幕)。
Thanks in advance. 提前致谢。
Following Stuart's advice below I confirmed that it is possible to integrate MvvmCross into an existing MonoCross application. 根据Stuart的建议,我确认可以将MvvmCross集成到现有的MonoCross应用程序中。
In the original code a selection on View 1 initiates a call to Controller 2 using MonoCross URI navigation. 在原始代码中,View 1上的选择使用MonoCross URI导航启动对Controller 2的调用。 Controller 2 displays View 2, passing it the data from Model 2. 控制器2显示视图2,从模型2传递数据。
Following the example in this video I created an MvvmCross View and ViewModel. 按照本视频中的示例,我创建了一个MvvmCross View和ViewModel。 A selection on View 1 still navigates to Controller 2 but Controller 2 now displays the new MvvmCross View 2. View 2 is data bound to ViewModel 2 which takes over Controller 2's functions of getting the Model data. View 1上的选择仍然导航到Controller 2,但Controller 2现在显示新的MvvmCross View 2. View 2是绑定到ViewModel 2的数据,它接管Controller 2获取Model数据的功能。
I don't know of anyone who's done this recently, but I originally ported several of the MonoCross samples over when I first created MvvmCross. 我不知道最近有人这么做过,但是我最初在创建MvvmCross时最初移植了几个MonoCross样本。 The overall idea of one page to one "ViewModel" stays the same, although the mvvm binding offers more continuous view-viewmodel interactions than the more discrete Controller-Action model. 尽管mvvm绑定提供了比更离散的Controller-Action模型更多的连续视图 - 视图模型交互,但是一个页面到一个“ViewModel”的整体思想保持不变。
At a practical level: 在实际水平:
#define
s rather than PCLs - so you may find it easier to not use PCLs in MvvmCross MonoCross应用程序倾向于使用文件链接和#define
而不是PCL - 因此您可能会发现在MvvmCross中不使用PCL更容易 I suspect the best option for this migration is to let your team experiment - they already have lots of knowledge about your app and about what they do and don't need and what benefits they do and don't get from a framework. 我怀疑这次迁移的最佳选择是让您的团队进行实验 - 他们已经掌握了很多关于您的应用程序的知识,以及他们做什么和不需要什么,以及他们从框架中获得和不做什么好处。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.