We're having this weird bug where if the application is opened and the user changes the windows font size here:
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.
精彩评论