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:
<LinearGradient Brush x:Key="CustomGr adientColor" EndPoint="0.5,1 "
StartPoint="0.5 ,0">
<GradientStop Color="#FFFFFFF F" Offset="0"/>
<GradientStop Color="#FFFFFFF F" Offset="1"/>
<GradientStop Color="#FF00000 0" Offset="0.755"/>
<GradientStop Color="#FF00000 0" Offset="0.550"/>
</LinearGradientB rush>
And lets say they pick a new color to replace "#FF000000" :
Brush newBrush = Brushes.Red;
Using c#, how can I change 'this.BackColor ' to CustomGradientC olor and swap
out "#FF000000" with newBrush in CustomGradientC olor?
Thanks.
--
moondaddy@newsg roup.nospam
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:
<LinearGradient Brush x:Key="CustomGr adientColor" EndPoint="0.5,1 "
StartPoint="0.5 ,0">
<GradientStop Color="#FFFFFFF F" Offset="0"/>
<GradientStop Color="#FFFFFFF F" Offset="1"/>
<GradientStop Color="#FF00000 0" Offset="0.755"/>
<GradientStop Color="#FF00000 0" Offset="0.550"/>
</LinearGradientB rush>
And lets say they pick a new color to replace "#FF000000" :
Brush newBrush = Brushes.Red;
Using c#, how can I change 'this.BackColor ' to CustomGradientC olor and swap
out "#FF000000" with newBrush in CustomGradientC olor?
Thanks.
--
moondaddy@newsg roup.nospam
Comment