什么硬件/平台差异可能导致XAML-WPF多绑定到复选框失败? [英] What hardware/platform difference could cause an XAML-WPF multibinding to CheckBox to fail?

查看:242
本文介绍了什么硬件/平台差异可能导致XAML-WPF多绑定到复选框失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是后续我的最后一个问题(见代码示例,我最后的评论接受的答案)。总之,我有一个多绑定在一个WPF DataGridTextColumn 到(本国) Person 对象和复选框。在我在办公室的几台电脑,它的工作原理正如预期 - 内容是根据 CheckBox 的状态更改根据我的对象实现 IMultiValueConverter 接口 - 但在现场测试的所有四台计算机(到目前为止),它失败。

This is a follow up to my last question (see code example there and my last comment on the accepted answer). In short, I've got a Multibinding on a WPF DataGridTextColumn to a (home-grown) Person object and a CheckBox. On several computers that I have in the office, it works as expected - the content is altered based on the state of the CheckBox according to my object that implements the IMultiValueConverter interface - but on all four computers tested (so far) in the field, it fails.

由于传递给 IMultiValueConverter 值数组的对象类型为 MS.Internal.NamedObject ,因此,我怀疑是空数据绑定对象, DependencyProperty.UnsetValue (但 ToString()没有给一个更清晰指示)。

The failure appears to be due to a faulty binding, as the object that is passed to the IMultiValueConverter value array has type MS.Internal.NamedObject, which I suspect is the null data binding object, DependencyProperty.UnsetValue (but ToString() didn't give a clearer indication).

表面上,这些计算机是相同地配置的,虽然它们不是来自克隆的映像。我的问题是硬件和/或平台的哪些方面可能导致多绑定的不同行为?或者,我可以尝试进一步调查问题的根源? (免责声明:我几乎是WPF和XAML的新手。)

Ostensibly, these computers are identically provisioned, though they're not literally from a cloned image. The question I have is what aspect(s) of the hardware and/or platform might possibly lead to a different behavior of the Multibinding? Or what can I try to further investigate the source of the problem? (Disclaimer: I'm pretty much a newbie to WPF and XAML.)

推荐答案

我搜索 MS.Internal.NamedObject ,并来到了这篇文章,这听起来像是可能相关的。

I did a search for MS.Internal.NamedObject and came to this post which sounds like it could be related.

最终的原因是WPF 4框架中的一个错误,它涉及到一个与一个ObservableCollection绑定的虚拟控件,并改变了DataContext。有一些解决方法发布在官方错误报告页面,最简单的解决方案似乎是升级您的版本的框架,如果可以。

The ultimate cause is a bug in the WPF 4 framework related to a virtualized control binding to an ObservableCollection, and changing the DataContext. There is some workarounds posted on the official bug report page, and the easiest solution appears to be to upgrade your version of the framework if you can.

这篇关于什么硬件/平台差异可能导致XAML-WPF多绑定到复选框失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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