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

穿精又带淫゛_ 提交于 2019-12-11 04:40:16

问题


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.

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).

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.)


回答1:


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

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.



来源:https://stackoverflow.com/questions/22536645/what-hardware-platform-difference-could-cause-an-xaml-wpf-multibinding-to-checkb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!