
We are attempting to consume the Actipro ThemeManager as the central theme controller for our application (rather than use the ThemeManager for the Actipro controls, and our own manager for everything else). The documentation suggests that we should be able to do this by creating our own ThemedResourceDictionary-derived class. However, there are no examples of doing this, and the documentation is a tad sparse. And, since you have wisely obfuscated your code, we can't use Reflector to see what you did.
Or, is what I am trying to accomplish not really the intended use of the ThemesManager? I mean, it seems to me that I should be able to define the appearance for all of the standard and custom controls that I want and register that as the "AeroNormalColor" theme, and have a different appearance defined which I have registered as the "Office2007Black" theme - so that when I tell the Theme Manager to use that theme, not only do the Actipro controls change, but all of the other controls in my application also change.
If there is a sample online somewhere that you can point me, that would be really helpful.
My initial questions are:
1) What is the LocationUri property expected to return? I have attempted to have it say:
return new Uri(@"Themes\Earth\EarthResources.xaml");
(since the Resource Dictionary that contains my theme definition is in that path in the project). However, when I do this, I get a System.UriFormatException: "Invalid URI: The format of the URI could not be determined." I also attempted:
return new Uri(@"pack://siteoforigin:,,,/Themes\Earth\EarthResources.xaml");
(since I wanted to allow the actual theme contents to be read in at run time), but I got a System.ArgumentException Cannot use absolute URI.".
2) If I want to have my theme apply a style/template to a standard control - say, Button - do I have to do anything special to make this happen? Normally, I would have added the EarthResources Resource Dictionary to App.xaml, and since that contains a style for Button, it would just get applied. One presumes that there is something that must be done so that a control knows it is part of a given "Group" (or, perhaps I just don't really understand the purpose/function of the Group property on the Theme...)
I realize that these are rather broad questions, but hopefully you can at least point me in the correct direction.
Thank you in advance.
David Mullin
Or, is what I am trying to accomplish not really the intended use of the ThemesManager? I mean, it seems to me that I should be able to define the appearance for all of the standard and custom controls that I want and register that as the "AeroNormalColor" theme, and have a different appearance defined which I have registered as the "Office2007Black" theme - so that when I tell the Theme Manager to use that theme, not only do the Actipro controls change, but all of the other controls in my application also change.
If there is a sample online somewhere that you can point me, that would be really helpful.
My initial questions are:
1) What is the LocationUri property expected to return? I have attempted to have it say:
return new Uri(@"Themes\Earth\EarthResources.xaml");
(since the Resource Dictionary that contains my theme definition is in that path in the project). However, when I do this, I get a System.UriFormatException: "Invalid URI: The format of the URI could not be determined." I also attempted:
return new Uri(@"pack://siteoforigin:,,,/Themes\Earth\EarthResources.xaml");
(since I wanted to allow the actual theme contents to be read in at run time), but I got a System.ArgumentException Cannot use absolute URI.".
2) If I want to have my theme apply a style/template to a standard control - say, Button - do I have to do anything special to make this happen? Normally, I would have added the EarthResources Resource Dictionary to App.xaml, and since that contains a style for Button, it would just get applied. One presumes that there is something that must be done so that a control knows it is part of a given "Group" (or, perhaps I just don't really understand the purpose/function of the Group property on the Theme...)
I realize that these are rather broad questions, but hopefully you can at least point me in the correct direction.
Thank you in advance.
David Mullin