开发者

Windows Font Size screws up WPF application

We're having this weird bug where if the application is opened and the user changes the windows font size here:

Windows Font Size screws up WPF application

When the font size is changed to extra large, one of our controls DataContext is changed to null, and its DataContextChanged event is called too.

Not really sure what is g开发者_Go百科oing on, nor why or what changes the DataContext of the control. Any help would be greatly appreciated.

Thanks!


I'm assuming ChartItemControl is a System.Windows.Controls.Control or UserControl. A Control's Unloaded event will be fired when modifying the windows theme, color scheme, or font size. If you are cleaning up resources by resetting DataContext when handling the Unloaded event, you will need to reset your DataContext when the control is loaded again or in OnApplyTemplate.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜