开发者

How do I set the theme for child controls with Infragistics?

开发者 https://www.devze.com 2022-12-08 10:17 出处:网络
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开发者_

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>

0

精彩评论

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