I have the following styles in WPF to draw and color a box, which is a custom control with various PART_Name items defined in a ResourceDictionary:
<ResourceDictionary>
.
.
.
<Brush x:Key="BoxStroke">#FFD69436</Brush>
<LinearGradientBrush x:Key="BoxBrush" StartPoint="0,0" EndPoint="0,1">
<LinearGradientBrush.GradientStops>
<GradientStop Color="#FAFBE9" Offset="0" />
<GradientStop Color="Green" Offset="1" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
<Style x:Key="BoxStyle" TargetType="Path">
<Setter Property="Fill" Value="{DynamicResource BoxBrush}"/>
<Setter Property="Stroke" Value="{DynamicResource BoxStroke}"/>
</Style>
<Style x:Key="Box" TargetType="Path" BasedOn="{StaticResource BoxStyle}">
<Setter Property="Data" Value="M 0,0 H 60 V40 H 0 Z"/>
</Style>
.
.
.
</ResourceDictionary>
My question is how can I access the GradientStop color property for the brush?
For instance if the user clicks on the box turn it from "Green" to "Blue".
I've got all of the appropriate code to handle user interaction, I am just stumped on how to change the color of the brush.