无法从System.Windows.Input加载GestureEventArgs

时间:2012-02-10 11:42:29

标签: windows-phone-7 xaml assemblies

我一直在寻找解决方案,但还没找到。

情况是我有一个自定义控件,它使用GestureEventArgs对“Tap”事件应用一些效果。 GestureEventArgs来自System.Windows.Input命名空间。顺便说一下,这是一个WP7(7.1)项目。如果我在其他WP7(7.1)项目中使用此控件,我的visual studio 2010就会崩溃。没有错误或例外。

当我在Blend中打开xaml文件时,出现以下错误:

  

TypeLoadException:无法加载类型   汇编中的“System.Windows.Input.GestureEventArgs”   “System.Windows.Input,version = 2.0.5.0,Culture = neutral,   公钥= 7cec85d7bea7798e“

我看到的唯一原因是,在我的其他项目的Microsoft.Phone.Controls命名空间中,还有一个GestureEventArgs。但是没有关于模棱两可的抱怨。

有人在这种情况下吗? 修复会很棒!

1 个答案:

答案 0 :(得分:1)

当我安装并引用Windows Phone Silverlight Toolkit时,我遇到了这个问题。它向System.Windows.Controls添加了一个新的GestureEventsArgs。我通过使用别名来处理System.Windows.Input

来解决这个问题
using input=System.Windows.Input;