How to setup Telerik controls theme and colors

Mar 25, 2013 at 12:14 AM
The approach is not very good because if the responsible change keys resources it breaks.

But as we have only exposed the AccentColor let it:
public static class TelerikAppearanceManager
    {
        public static void SetupTheme()
        {
            Telerik.Windows.Controls.StyleManager.ApplicationTheme = new Telerik.Windows.Controls.Windows8Theme();
        }

        public static void SetupThemeColors()
        {
            Telerik.Windows.Controls.Windows8Palette.Palette.AccentColor = AppearanceManager.AccentColor;

            var appColor = Application.Current.Resources["WindowBackgroundColor"] as Nullable<Color>;
            if (appColor.HasValue)
                Telerik.Windows.Controls.Windows8Palette.Palette.MainColor = appColor.Value;

            var textColor = Application.Current.Resources["ItemText"] as SolidColorBrush;
            if (textColor != null)
                Telerik.Windows.Controls.Windows8Palette.Palette.MarkerColor = textColor.Color;

            var markerColor = Application.Current.Resources["InputBorder"] as SolidColorBrush;
            if (markerColor != null)
                Telerik.Windows.Controls.Windows8Palette.Palette.StrongColor = markerColor.Color;

            var basicColor = Application.Current.Resources["InputBorder"] as SolidColorBrush;
            if (basicColor != null)
                Telerik.Windows.Controls.Windows8Palette.Palette.BasicColor = basicColor.Color;
        }
    }
On App.xaml.cs inside "OnStartup":
TelerikAppearanceManager.SetupTheme();
On SettingsAppearanceViewModel.cs inside "OnThemeChanged" at and:
TelerikAppearanceManager.SetupThemeColors();
Mar 26, 2013 at 1:32 PM
Many thanks for the tip!
Apr 11, 2013 at 4:05 PM
by the way, and you have no problems with the control ListBox? for example in my telerik RadAutocompliteBox the drop-down list, a transparent background. and this can be remedied only if the resources UserControl add styles
    <Style TargetType="telerik:RadListBox">
        <Setter Property="Background" Value="White"/>
    </Style>
    <Style TargetType="telerik:RadListBoxItem">
        <Setter Property="Background" Value="White"/>
        <Setter Property="BorderBrush" Value="White"/>
    </Style>
    <Style TargetType="ScrollBar">
        <Setter Property="Background" Value="White"/>
    </Style>

then all fall into place.