I am trying to databind the color of a RadialGradientBrush in silverlight 3 to a property, but just can\'t seem to get it to work.
For example, in a sample test app all
Ok, I solved this problem by going one level higher and databinding the RadialGradientBrush itself.
<Rectangle x:Name="testRectangle" Height="100" Width="100"
Fill="{Binding TestRadialGradientBrush}"
DataContext="{Binding ElementName=HomePageUC}" >
</Rectangle>
The RadialGradientBrush in turn is instantiated with the GradientStops set to the colors I want in the code behind.
Unfortunately, you cannot do that since Binding happens on FrameworkElement and every object that inherits it. GradientStop is not a FrameworkElement, which prevents you from binding its Color property.