简体   繁体   English

是否可以将MonoCross应用程序逐步迁移到MvvmCross?

[英]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: 在实际水平:

  • MvvmCross itself is very modular and can be used in "CrossLight" mode where it simply provides data-binding and plugins - see CrossLight in http://mvvmcross.wordpress.com/ . MvvmCross本身非常模块化,可以在“CrossLight”模式下使用,它只提供数据绑定和插件 - 请参阅http://mvvmcross.wordpress.com/中的 CrossLight。 You might be able to use this for migrating pages one-by-one 您可以使用它来逐个迁移页面
  • MonoCross isn't really very interface/IoC based - so you may find that your resulting MvvmCross migration would also not be interface based either MonoCross实际上不是非常基于接口/ IoC的 - 因此您可能会发现您的MvvmCross迁移也不是基于接口的
  • MonoCross apps tend to use file-linking and #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.

相关问题 在MonoCross.Touch应用程序中使用“ MXTouchViewGroup *”的MonoCross示例 - MonoCross Example using “MXTouchViewGroup*” in a MonoCross.Touch application 如何在MVVMCross应用程序中替换MvxDefaultViewModelLocator - How to replace MvxDefaultViewModelLocator in MVVMCross application MVVMCross:是否可以将Storyboard与ICommand导航一起使用? - MVVMCross: Is it possible to use Storyboard with ICommand navigation? Monocross和Monotouch(xamarin)之间的区别? - Difference between Monocross & Monotouch (xamarin)? Monocross / HTML5与MonoDroid / MonoTouch / Windows - Monocross/HTML5 with MonoDroid/MonoTouch/Windows Monocross是否已准备好在iOS设备上使用? - Is Monocross ready for professional use on an iOS device? 在Windows Phone 7上使用Monocross和Panorama和/或Pivot控件 - Using Monocross on Windows Phone 7 with Panorama and/or Pivot control 使用MVVMCross 4和Xamarin.iOS是否可以将VM中的属性绑定到控制器中的本地属性 - Is it possible binding a property from VM to a local property in the controller, using MVVMCross 4 and Xamarin.iOS 使用MonoCross,SQLite数据库的创建应该放在哪里? - Using MonoCross, where should the creation of SQLite databases live? 使用V3创建MvvmCross应用程序-iOS上缺少System.Windows - Creating MvvmCross Application using V3 - System.Windows missing on iOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM