c# - Xamarin 表单错误值不能为空。参数名称 : type

标签 c# xamarin.forms null gesture-recognition

一整天,我都收到了这条非常明确(不是讽刺)的错误消息“值不能为空。参数名称:类型”我正用头撞墙慢慢分解我的代码,直到我能找出问题的确切原因。经过大量繁琐的解构之后,我发现我的 GestureRecognizers 中有一个错误。部分。问题是我不小心输入了 Command 来尝试传递参数而不是 CommandParameter .
我生成错误的原始代码如下所示。

<Label.GestureRecognizers>
    <TapGestureRecognizer Tapped="Value_Tapped" Command="language" />
</Label.GestureRecognizers>
更正后的代码是这样的:
<Label.GestureRecognizers>
    <TapGestureRecognizer Tapped="Value_Tapped" CommandParameter="language" />
</Label.GestureRecognizers>
我希望这会在将来对其他人有所帮助。

最佳答案

在遵循 this 中的每个步骤后,我设法解决了这个问题。邮政:

  • 清洁溶液。
  • 关闭 Visual Studio。
  • 删除 binobj解决方案中每个项目的目录( YourProjectYourProject.AndroidYourProject.iOS )
  • 重新启动 Visual Studio。
  • 单独构建每个项目 - 不要重新构建解决方案。
  • 重建解决方案。
  • 关于c# - Xamarin 表单错误值不能为空。参数名称 : type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40825071/

    相关文章:

    c# - Xamarin.Forms 中编辑器的边框颜色

    java - 为什么我的 Spring @Autowired 字段为空?

    c# - 无法使用 $find 找到 Rad Treeview

    c# - 在 C# 中使用文件的 TransactionScope

    c# - 如何更新Blazor View?

    c# - 如何翻译或转换 CompilerGenerated 代码?

    c# - Xamarin DependencyService : System. MissingMethodException:找不到 [Interface] 的默认构造函数

    xaml - Xamarin CollectionView 滚动不顺畅

    mysql - 如何添加一个带整数的空字段?

    ruby-on-rails - CartsController 中的 NoMethodError#destroy - 使用 Rails 4 进行敏捷 Web 开发