This question is locked. New answers and comments are not allowed.
Is it possible to bind to the Metro Theme AccentColor in code behind?
I found it easy to do in XAML: http://www.telerik.com/help/silverlight/common-styles-appearance-colorizing-metro-theme.html
<SolidColorBrush x:Key="AccentBrush" Color="{Binding Source={StaticResource MetroColors}, Path=Palette.AccentColor}" />
Setting the color using radGrid.BorderBrush = new SolidColorBrush(MetroColors.PaletteInstance.AccentColor); does not update the radGrid's BorderBrush when the AccentColor is changed.
In code behind I'm get the exception "Cannot find a Resource with the Name/Key MetroColors [Line: 10 Position: 36]" when I try to use the following binding:
Binding accentColor = new Binding("Palette.AccentColor");
accentColor.Source = App.Current.Resources["MetroColors"];
accentColor.Converter = new ColorToBrushConverter();
radGrid.SetBinding(RadGridView.BorderBrushProperty, accentColor);
I found it easy to do in XAML: http://www.telerik.com/help/silverlight/common-styles-appearance-colorizing-metro-theme.html
<SolidColorBrush x:Key="AccentBrush" Color="{Binding Source={StaticResource MetroColors}, Path=Palette.AccentColor}" />
Setting the color using radGrid.BorderBrush = new SolidColorBrush(MetroColors.PaletteInstance.AccentColor); does not update the radGrid's BorderBrush when the AccentColor is changed.
In code behind I'm get the exception "Cannot find a Resource with the Name/Key MetroColors [Line: 10 Position: 36]" when I try to use the following binding:
Binding accentColor = new Binding("Palette.AccentColor");
accentColor.Source = App.Current.Resources["MetroColors"];
accentColor.Converter = new ColorToBrushConverter();
radGrid.SetBinding(RadGridView.BorderBrushProperty, accentColor);