M
moondaddy
I have a custom control where users can set the backcolor of one of it's UI
elements via a DP I created. One of the colors they can pick is a brush
called CustomGradient where I would set the DP to this brush. Then from a
color picker I would let them pick a solid color brush and set 2 of the
gradient stops to this new value.
So for example, here's the style:
<LinearGradientBrush x:Key="CustomGradientColor" EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FFFFFFFF" Offset="0"/>
<GradientStop Color="#FFFFFFFF" Offset="1"/>
<GradientStop Color="#FF000000" Offset="0.755"/>
<GradientStop Color="#FF000000" Offset="0.550"/>
</LinearGradientBrush>
And lets say they pick a new color to replace "#FF000000":
Brush newBrush = Brushes.Red;
Using c#, how can I change 'this.BackColor' to CustomGradientColor and swap
out "#FF000000" with newBrush in CustomGradientColor?
Thanks.
elements via a DP I created. One of the colors they can pick is a brush
called CustomGradient where I would set the DP to this brush. Then from a
color picker I would let them pick a solid color brush and set 2 of the
gradient stops to this new value.
So for example, here's the style:
<LinearGradientBrush x:Key="CustomGradientColor" EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FFFFFFFF" Offset="0"/>
<GradientStop Color="#FFFFFFFF" Offset="1"/>
<GradientStop Color="#FF000000" Offset="0.755"/>
<GradientStop Color="#FF000000" Offset="0.550"/>
</LinearGradientBrush>
And lets say they pick a new color to replace "#FF000000":
Brush newBrush = Brushes.Red;
Using c#, how can I change 'this.BackColor' to CustomGradientColor and swap
out "#FF000000" with newBrush in CustomGradientColor?
Thanks.