开发者

Windows Font Size screws up WPF application

开发者 https://www.devze.com 2023-01-08 18:36 出处:网络
We\'re having this weird bug where if the application is opened and the user changes the windows font size here:

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

精彩评论

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