How can i apply a style to, for example, a button, when using the new ThemeManager to theme MS WPF controls? If I apply any style, the IG theme is disregarded? See the sample app. It shows a button with an explicit style that just sets its width and height. But when i apply it to my button, the button no longer takes the properties from the ThemeManager. I tried BasedOn, it didn't help. Also, Implicit styling of a button seems to be ignored (commented out in my sample as to show No Style). Is there a way to accomplish styling the button based of the IG Theme?
Hi Travis,
Your BasedOn style actually does work but because of the order in which things are added to the Application.Resources, the ThemeManager resource dictionary is getting priority over the based on Button style. The first dictionary added to the Application.Resources.MergedDictionaries collection is your explicit styles one. After which the IG Theme resource dictionary is added. Since it was added second, it's resources have priority.
If you move your resource dictionary into the MainWindow.Resources you'll see that your BasedOn style works. So in order for your custom styles to be used, they need to basically be added after the ThemeManager's resources.
Given that i use this button theme throughout my application (many windows etc), is there a way i can delay or otherwise get the style to be applied in a way that will allow it to work other than placing it in EVERY window's resources? Thanks