I'm trying to do something so simple but cannot get anywhere with it. I've been trawling the net trying to find a clear example or tit bit of information but every article I find is showing the exact same simple example.
All I want to do is have a background to a list box item that is two tone but without a gradial blend between them. So far I have:
<Setter Property="Background" >
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#ACC6E0" Offset="0"/>
<GradientStop Color="#DCE7F5" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
I've tried plenty of different things but all I end up with is a variant of a gradual gradient not a two tone equal split.
Many Thanks
Paul
Just add two stops at the same offset:
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#ACC6E0" Offset="0"/>
<GradientStop Color="#ACC6E0" Offset="0.5"/>
<GradientStop Color="#DCE7F5" Offset="0.5"/>
<GradientStop Color="#DCE7F5" Offset="1"/>
</LinearGradientBrush>
In fact you can drop the end points:
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#ACC6E0" Offset="0.5"/>
<GradientStop Color="#DCE7F5" Offset="0.5"/>
</LinearGradientBrush>
You need to add extra GradientStops:
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#ACC6E0" Offset="0"/>
<GradientStop Color="#ACC6E0" Offset="0.5"/>
<GradientStop Color="#DCE7F5" Offset="0.5"/>
<GradientStop Color="#DCE7F5" Offset="1"/>
</LinearGradientBrush>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With