Does MvvmCross work in Xamarin Studio?

Deadly 提交于 2019-12-21 17:48:49

问题


I'm having a time getting a straight answer on this, I've done a lot of searches and reading, and tried a lot of stuff. It sometimes sounds possible and other times only sounds possible by doing linking and what-not, which is something I'm trying to avoid. I'm a big fan of PCLs.

I've created a solution using Visual Studio 2012, Xamarin, and MvvmCross which works great, I can deploy to an iOS device, a Droid device, Windows --- what have you. Visual Studio can build working applications that I can deploy to specific platforms.

However, I was informed recently that our company requires that when we go to deploy, the code must be built on a Mac using Xamarin Studio by their build server. So since then I've been working on trying to open and build everything using Xamarin Studio, and I'm close, but the infamous ICommand issue is my final hurdle.

Is there, or is there not, a way to get ICommands and the System.Windows library ported in correctly in Xamarin Studio? Am I truly stuck until Xamarin releases their PCL support?


回答1:


Does MvvmCross work in Xamarin Studio?

Yes

To prove it:

  • quite a few of the N+1 videos show this being used.
  • lots of the samples (all of the non-nuget ones) build and run from XS

Is there, or is there not, a way to get ICommands and the System.Windows library ported in correctly in Xamarin Studio?

The problem currently is that on the Stable branch, the xamarin compiler doesn't like the PCL import of MvxCommand which inherits from ICommand

A hard way around this problem is:

  • rewrite the Xamarin tools to support PCLs - this is what the brilliant, lovely and very clever Xamarin monkeys are currently doing :)

Or... a slightly easier way around this problem is:

  • replace the nuget references to the PC-built libraries with references to the Xamarin-Mac-built libraries instead - these Xamarin-Mac-built libraries are available in https://github.com/slodge/MvvmCross-Binaries/

Or... a really easy way around the problem is:

  • instead of using MvxCommand in your view models, just implement your own MyCommand class to implement System.Windows.Input.ICommand (e.g. use the implementation at http://www.lines-davies.net/blog/?p=24)

Am I truly stuck until Xamarin releases their PCL support?

I don't think so - but where you do hit problems:

  • please do come back to sites like StackOverflow with one specific problem at a time - this site is great for finding solutions one at a time :)
  • talk to Xamarin support - they are generally very helpful in trying to resolve issues.

What's more, even if you were stuck waiting... then Xamarin have already released their PCL support to the Alpha channel - so the wait is almost over already :)



来源:https://stackoverflow.com/questions/17369818/does-mvvmcross-work-in-xamarin-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!