【发布时间】:2019-10-02 23:54:42
【问题描述】:
我在使用 Xaml 的 Xamarin Forms 内容页面的 initializecomponent 方法上遇到异常。异常发生在生成的 xaml.gs 页面上。我没有从工作版本更改任何代码。也许上游发生了一些变化。异常消息是“”
值不能为空。 参数名称:绑定
堆栈跟踪: 在 D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs 中的 Xamarin.Forms.BindableObject.SetBinding(Xamarin.Forms.BindableProperty targetProperty,Xamarin.Forms.BindingBase 绑定,System.Boolean fromStyle)[0x00011] :293 在 D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:117 中的 Xamarin.Forms.BindableObject.SetBinding(Xamarin.Forms.BindableProperty targetProperty,Xamarin.Forms.BindingBase 绑定)[0x00000] 在 ....LoginPage.InitializeComponent () [0x00045] 在 ...\obj\Debug\netstandard2.0\Views\Navigation\Login.xaml.g.cs:34 在 ..\Views\Navigation\Login.xaml.cs:25 中的 FieldServices.LoginPage..ctor () [0x0002b]
发生地点:
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Forms.Build.Tasks.XamlG", "0.0.0.0")] 私人无效初始化组件(){ 全局::Xamarin.Forms.Xaml.Extensions.LoadFromXaml(this, typeof(LoginPage)); email = global::Xamarin.Forms.NameScopeExtensions.FindByName(this, "email"); 密码 = 全局::Xamarin.Forms.NameScopeExtensions.FindByName(this, "password"); loginButton = global::Xamarin.Forms.NameScopeExtensions.FindByName(this, "loginButton"); }
【问题讨论】:
-
我应该在 xaml 预览器中添加 xaml 预览,所以我怀疑它是 xaml 错误
-
您的装订部分似乎有问题。你能提供一些代码来指定更多吗?此外,你能在一个新的空白项目上重现它吗?
-
这只发生在这个项目上。它发生在任何 xaml 页面上,所以我不确定绑定的内容和位置。一些 xaml 页面没有绑定
标签: xamarin xamarin.forms