All too often you’d like to give your users a way to theme your applications at runtime. Theming entire screens containing multiple Infragistics NetAdvantage WPF LIne of Business controls is easy to implement and could be a valuable addition to your applications. It involves setting the value of the Theme property to the currently set theme on the application level.
The approach is implemented in a sample project, which is available here. It is built using Visual Studio 2010 and Infragistics NetAdvantage for WPF Line of Business 10.3 (a free 30-day trial is available). The download package contains trial versions of the libraries, so you can build and run it immediately. Here're a couple of screenshots showing how two windows containing a variety of Infragistics WPF LOB controls are themed using the DropDown in the main window.
For all Infragistics WPF Line of Business controls that you’d like to theme, you need to set their Theme property to “[Current]”. This will bind their Theme property to the ThemeManager CurrentTheme property.
You can then set the CurrentTheme property of the ThemeManager to change the theme applied to all controls in the application. For example the statement below will cause all Infragistics WPF Line of Business controls to be themed using the Office 2007 Black theme:
In the sample, we control the theme used using a DropDown control, which is populated with the list of themes available in the ThemeManager using its GetThemes method.
Allowing your end-users to theme your application increases its usability as it enables your users to set the appearance they’re most comfortable with. As you can see, with a very small number of changes you can enable that and deliver a flexible theming in your applications using Infragistics WPF Line of Business controls.
If you have any questions, please email me at firstname.lastname@example.org