Is there any way to apply a StyleRepository object to a control? I know I can do something like:
Theme currenTheme = ThemeRepository.FindTheme(ThemeResolutionService.ApplicationThemeName);
StyleRepository repositoryFromTheme = currenTheme.FindRepository("DisabledForeColor");
PropertySetting styleForeColor = repositoryFromTheme.FindSetting("ForeColor");
Color colorToSet = (Color)styleForeColor.Value;
myTextBox.Forecolor = colorToSet;
However, if I have multiple properties to set (say, multiple colors and maybe some transparency or a background image or something), this can get a bit tedious and it lacks flexibility. So, what I'd like to do is just take the StyleRepository object and apply it directly to the control. Alternately, I'd be fine with looping through the settings collection and applying each of those individually so long as I didn't have to hard code the names of the PropertySettings into my code. Something like:
foreach (PropertySetting currentPropertySetting in repositoryObjectFromTheme.Settings)
{
genericRadControl.SOMETHING = currentPropertySetting;
}
would work for me fine as well.
Any suggestions?