Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将视图模型变量与标签的启用属性绑定,但它会使应用程序崩溃
bindings.Add(this.SetBinding(() => this.Vm.IsEnabled, () => this.lblDate.Enabled, BindingMode.TwoWay));
在发布模式下,崩溃总是可以重现的。
这是崩溃报告
看起来 lblDate 的 Enabled 属性没有公共设置器,但作为一个控件,我几乎可以肯定它有。我在此页面上发现一种解决方案是将 [Preserve] 属性添加到视图模型中的属性