简体   繁体   English

哪些硬件/平台差异可能导致对CheckBox的XAML-WPF多重绑定失败?

[英]What hardware/platform difference could cause an XAML-WPF multibinding to CheckBox to fail?

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 . 简而言之,我在WPF DataGridTextColumn实现了对(自家的) Person对象的Multibinding DataGridTextColumn和一个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接口的对象,根据CheckBox的状态更改内容-但在该领域(到目前为止)测试的所有四台计算机上,它失败。

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). 该失败似乎是由于绑定错误所致,因为传递给IMultiValueConverter值数组的对象的类型为MS.Internal.NamedObject ,我怀疑这是空数据绑定对象DependencyProperty.UnsetValue (但ToString()没有) t给出更清晰的指示)。

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 ? 我的问题是,硬件和/或平台的哪些方面可能会导致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.) (免责声明:我几乎是WPF和XAML的新手。)

I did a search for MS.Internal.NamedObject and came to this post which sounds like it could be related. 我搜索了MS.Internal.NamedObject并来到了这篇帖子 ,听起来可能是相关的。

The ultimate cause is a bug in the WPF 4 framework related to a virtualized control binding to an ObservableCollection, and changing the DataContext. 最终的原因是WPF 4框架中的一个错误,该错误与绑定到ObservableCollection的虚拟化控件以及更改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. 官方的错误报告页面上发布了一些变通办法,并且最简单的解决方案似乎是如果可以的话,升级框架的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM