I'm using the Infragistics WPF controls in a new project, and I'd like to take advantage of their themes support. I'm able to change the theme of my window (and toolbars) via the OnThemeChan开发者_如何学编程ged event, but I can't figure out how to change the theme of child controls (such as the XamDockManager), as they're added at runtime.
I'm new to WPF and Infragistics controls so any clarification is appreciated.
I discovered the answer.
You need to set the control's Theme
property to Theme.CurrentTheme
. This will cause the controls to automatically pick up the new theme via their internal OnThemeChanged
events.
This is the code I used, simplified a bit for this answer:
<igDock:ContentPane xmlns:igTheme="clr-namespace:Infragistics.Windows.Themes;assembly=Infragistics3.Wpf.v9.1">
// other stuff
...
<igDock:XamDockManager "Theme="igTheme:ThemeManager.CurrentTheme" />
</igDock:ContentPane>
精彩评论