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!
Thanks Rob, your sample works like a charm. However when i do the same in the solution I am working on, when I add a theme for say the "Ribbon" grouping it actually applies changes to everything, not only the ribbon. Which is rather confusing, because i have tried reproducing the same in your example and I couldnt make it.
I will consider that my solution has something wrong, or there is maybe a weird bug that we are bumping into. But assuming we had the correct behavior and we wanted to apply styles to just about everything, how woudl you do it? I haven't seen any way to get all the groupings that are registered.
We have tried using the "Primitives" grouping and it seems that it applies changes to all the objects, is this correct? It would be great if that is the case.
Thanks a lot for your assistance!
Hi Dzyann,
Groupings are used to determine which controls actually use the registered theme. If, for example, you have a XamRibbon, XamDataGrid and XamDockManager on the screen and you registered a theme for the "DockManager" group, when you set the current theme it's only going to apply the theme to the dock manager. Even if your resource dictionary has styles for the ribbon and XamDataGrid, only the XamDockManager is actually going to accept the theme.
So let's say that you want to create a theme that targets multiple controls. To do this you need to register the theme multiple times for each grouping that you want included.
ThemeManager.Register("MyTheme", "Ribbon", dictionary); ThemeManager.Register("MyTheme", "DockManager", dictionary); ThemeManager.Register("MyTheme", "DataPresenter", dictionary);
I've attached a sample that demonstrates this. The samples shows how the themes can be targeted at specific controls and how they can be applied to all controls.
Hi Rob,
So i kept working and trying different things, debugging I could find a collection that shows groups. I don't understand how the whole grouping concept works.
I set "Ribbon" as the group, and my sample worked. It applies the changes to just about everything, even the DockManager and other controls. Why is that? Why the Ribbon group seems to apply changes to so many different controls? What controls do not change when the Ribbon is the group?
What is the group that covers everything? I am setting a theme so all my controls change with the theme, I wouldnt like to have some controls not changing because they don't belong to a group.
What would be the most generic group? "Primitives"?
Thanks Rob,
We use the Theme="[current]" in the code, and it is not working still.
How can I know the available groups? And what if i want something to be aplied to everything and not just one control? Is this literal for those cases: ThemeManager.AllGroupingsLiteral? Because using this literal causes an exception.
Thanks in advance!
Actually there are more groupings but this depends on what assemblies are loaded into the application. For example, previously I only saw 3 groupings in the ThemeManager while debugging but after I added the XamRibbon assembly I now see a Ribbon group so there are definitely more than 3 groupings.