WPF Checkbox state does not update in FixedPage

谁都会走 提交于 2019-12-05 13:23:15

I have found the problem and I have also found some beginning of a solution.

Apparently enabled checkboxes do not check when exported to wpf. I guess the developers' idea when they wrote the code is that enabled checkboxes on a piece of paper should only be checked by hand. Most unfortunately for me, I want to check them programmatically.

I have also found some solution to this problem. Disabled checkboxes are shown as checked and unchecked. With the major drawback of course that they're all greyed out, like disabled checkboxes are supposed to look like.

Well... I guess it's time to figure out how to restyle my disabled checkboxes to look like they're enabled. Hmmm.... maybe printing five of them on top of each other? Fingers crossed!

Eternal21

The same issue happens with RadioButtons. I solved it by displaying my FixedDocument in PrintPreview window before printing (using DocumentViewer) (link: http://www.nbdtech.com/Blog/archive/2009/07/09/wpf-printing-part-4-ndash-print-preview.aspx).

EDIT: Coming back to this question almost half a year later. The requirement for my application changed, and I had to implement silent printing, which no longer allowed me to use PrintPreview window workaround mentioned above. The solution ended up being similar to the one mentioned in the other answer. I ended up adding custom checkbox/radiobutton template, and disabling IsEnabled style triggers. The issue is finding Aero BulletChrome template. The following question helped in that respect https://stackoverflow.com/a/24863563/1288473

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