Hi,
Lib: Infragistics WPF v2016.1
Atm we are allowing users to choose Theme they want (out of 5) that you have in your sample browser. But I can see we have quite a few THeme.X.dlls (like InfragisticsWPF4.Themes.Wind.v16.1.dll and InfragisticsWPF4.Themes.Water.v16.1.dll).
Can you give me an example of how to load them and use then as per below:
ThemeManager.ApplicationTheme = new IgTheme();
Hello Anvarbek,
Being that you are setting the static ApplicationTheme property of the ThemeManager in your provided code, it appears that you are using the Infragistics.Themes.ThemeManager tool. This tool has no access to the themes such as Wind, Water, Fall, Lipstick, etc, but the Infragistics.Windows.Themes.ThemeManager does.
The reason for this is because the Fall, Water, Wind, etc. themes are used and are currently only accessible by the WPF-specific controls that Infragistics exposes, such as the XamDataGrid. A list of these WPF-Specific controls can be found here: http://help.infragistics.com/doc/WPF/2015.2/CLR4.0/?page=WPF_Specific_Controls_Landing_Page.html. The Infragistics.Windows.Themes.ThemeManager tool can style these controls with these particular themes.
The Infragistics.Themes.ThemeManager tool is meant to be able to apply themes to any other control, but the Fall, Water, Wind, etc. theme dictionaries have no stylings for the controls that are not "Infragistics WPF-Specific." This tool can theme essentially anything with any theme that inherits from ThemeBase. The built-in themes that inherit from ThemeBase include Metro, MetroDark, Office2013, IGTheme, and Office2010Blue theme.
I hope this helps you. Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Tnx Andy,
That makes sense. When i looked at Infragistics.Windows.Themes.ThemeManager, i could see you can apply wpf specific theme from code behind using string value.
Can you give me an example where i can set it to "Water" theme pls?
Also, so i need to register any extra dict resources apart from just having ref to theme.x.dlls?
The only thing you will need to include is the theme-related assembly, but I had left something out before. When using the Fall/Water/Wind related themes, you need to be sure that the assemblies for these themes are loaded. To do this, I would recommend placing a call to the following prior to the InitializeComponent call for your MainWindow:
Infragistics.Windows.Themes.Water.DataPresenter water = new Infragistics.Windows.Themes.Water.DataPresenter();
This will ensure that the theme assemblies will be loaded, and it will allow you to set the theme to your WPF-Specific Infragistics control using the static SetTheme method of the Infragistics.Windows.Themes.ThemeManager.
I have attached an example project that demonstrates how one may apply the "Water" theme to the WPF-Specific XamDataGrid.
Please let me know if you have any other questions or concerns on this matter.
Thanks Andy for that example, helps me a lot learning the correct way to manage themes.