有没有绑定的iOS个ICommand在MvvmCross 3.0.14不同的方法? [英] Is there a different method to bind iOS ICommands in MvvmCross 3.0.14?

查看:155
本文介绍了有没有绑定的iOS个ICommand在MvvmCross 3.0.14不同的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下载时,该教程N =的MvvmCross的N + 1日5版在Xamarin Studio的罚款。但是,如果我更新组件从3.0.5到3.0.14,iOS的项目不再生成。错误有以下两行做的:

  set.Bind(按钮)。为了(VM => vm.MyCommand ); 
set.Bind(按钮2)。为了(VM => vm.GoSecondCommand);



该错误消息如下:



<块引用>

不能转换`lambda表达式'非委托类型'字符串'




以前有变化这种工作方式?对象浏览器显示正确的方法服用 Func键< TSource,对象> 但似乎编译器要使用字符串版本。奇怪的是,这两个行上面结合常规性能做工精细,但的ICommand 绑定的东西失败。




h2_lin>解决方案

由于N = 5的拍摄,

由于这种支持的一部分,你需要在添加引用的大会部分增加对你的触摸UI项目的项目引用 System.Windows.dll中



这System.Windows程序集包含的ICommand的类型定义转发 - 这应该清除编译错误


The tutorial N=5 of the N+1 days of MvvmCross builds fine in Xamarin Studio when downloaded. However, if I update the assemblies from 3.0.5 to 3.0.14, the iOS project no longer builds. The error has to do with these two lines:

set.Bind(button).To(vm => vm.MyCommand);
set.Bind(button2).To(vm => vm.GoSecondCommand);

The error message is as follows:

Cannot convert `lambda expression' to non-delegate type `string'

Has there been a change to the way this works? The object browser shows the correct method taking a Func<TSource, object> but it seems that the compiler wants to use the string version. The odd thing is that the two lines above it binding to regular properties work fine, but the ICommand binded stuff fails.

解决方案

Since N=5 was filmed, xamarin have added their own pcl support

As part of this support, you need to add a project reference for your Touch UI project to System.Windows.dll in the Assemblies part of Add Reference.

This System.Windows assembly contains a type forwarding definition of ICommand - and this should clear your compilation error

这篇关于有没有绑定的iOS个ICommand在MvvmCross 3.0.14不同的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆