Greetings,
I am currently working on a project that then is reused in other projects. We use the ThemeManager and set the CurrentTheme in the App.xml.cs to whatever theme we wish. Our controls then have the property theme set to Current theme. From what I have read this is the way to go to set Infragistics themes at application level.
One of the projects we are working with would like to create a Custom Theme and use it in the same way. But I don't know if it is possible and how to do it. Their themes are the same than the default ones but with some changes for specific controls. They a project resourvces with a folder Themes and then a folder for the IG, Metro and Office2010Blue modified themes. In there they have a bunch of xaml files for the different controls and Styles (Colors.xaml, Metro.xamDataTree.xaml, Styles.WPF.xaml, etc)
In this post John Doe posted a link on how to create Custom themes but it is broken. And have seen other posters related with themes, but do not seem to be what I need (like the utility to wash the themes).
I would like to know what are the steps we should take in order to make use of these themes with the ThemeManager.CurrentTheme property.
Thanks!
I don't know if anyone is following this thread, so I've created a new thread for the issue here.
Hi Rob,
I know it has been a while since I asked this, but since we upgraded to Infragistics 2015.1 setting the Theme through the ThemeManager is not longer working.
For example, if at runtime we set:
ThemeManager.CurrentTheme = "Onyx";
Nothing happens. It seems like some major change on the ThemeManager has been introduced on infragistics 2015.1.
How can you change the Theme at runtime now? Also, is doing Theme="[current]" still a valid technique for setting the theme on the controls so it changes according to what the ThemeManager is using?
Thank you!
Hi Dzyann,
You're very welcome. Let me know if you have any further questions on this matter.
Thanks a lot for your help!
You can get the groupings registered for a particular theme by using ThemeManager.GetGroupingsForTheme(). Again, this will only show you the groupings that pertain to the actual controls that you have loaded into your application.
Actually, this should meet your requirement as long as you already have the controls you are planning to use in your application. You can call the method passing in "IGTheme" and it will return a string array full of groupings. You can then iterate over the array and Register your custom theme for each of the groupings.
string[] groupings = ThemeManager.GetGroupingsForTheme("IGTheme"); foreach (string group in groupings) ThemeManager.Register("MyTheme", group, resourceDictionary);
I don't know if the Primitives group covers everything. From my tests it seems like it does but it's probably safer to use the above code.