Xamarin.Xamarin.Forms iOS的行为 [英] Xamarin.Behaviors with Xamarin.Forms iOS

查看:80
本文介绍了Xamarin.Xamarin.Forms iOS的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天,我陷入了与Xamarin.Behaviors和Xamarin.Forms相关的错误.详细信息是在我的xaml页面中添加以下代码行后引发的异常:

Yesterday, I stuck in a bug relative to Xamarin.Behaviors and Xamarin.Forms. The detail is a Exception was thrown after i add these code line in my xaml page:

 <b:Interaction.Behaviors>
        <b:BehaviorCollection>
        <b:EventToCommand EventName="Clicked" Command="{Binding MyCommand}" />
        </b:BehaviorCollection>
 </b:Interaction.Behaviors>  

尽管如此,我还是将这一行添加到了xaml命名空间

Although, I've added this line to xaml namespace

xmlns:b="clr-namespace:Xamarin.Behaviors;assembly=Xamarin.Behaviors"

应用程序异常崩溃:无法加载文件或程序集'Xamarin.Behaviors'或其依赖项之一.系统找不到指定的文件."

Application got crash with exception: "Could not load file or assembly 'Xamarin.Behaviors' or one of its dependencies. The system cannot find the file specified."

特别是,它仅在iOS,Android和wp上运行良好.所以,我想这可能是xamarin bug或xamarin studio bug ...

Specially, It's only happened on iOS, android and wp still work well. So, I guess this could be xamarin bug or xamarin studio bug ...

P/S:我检查了Xamarin.Behaviors是否存在于我项目的package文件夹中,并且App仍未找到该程序集所在的位置

P/S: I checked that Xamarin.Behaviors existed in package folder in my project, and App still not found where that assembly is

推荐答案

以帮助也从事此bug的人员.我将发布我的答案以显示对此的解决方案. Nuget的这个库有问题,我们不能再使用它.我必须忘记Nuget并将该库中的整个类复制到我的项目中.因此,它看起来像是您编写的代码,而不是库.当然,我们必须手动更新它,而不是像以前那样使用Nuget. 也许,这种解决方案只是暂时的.有人会找到更好的答案,我将更改答案.

To help somebody who also engage this bug. I will post my answer to show my solution for this. Nuget has problem with this lib and we can't use it anymore. I have to forget the Nuget and copy full of class in this library to my project. So, It look like your code which you wrote, not the library. Of course, we have to update this manually instead of use Nuget as before. Maybe, this solution is just temporary. Someone would find better one and I'll change my answer.

这篇关于Xamarin.Xamarin.Forms iOS的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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