Silverlight XAML Primer 4: Listing 1

Using the LinearGradientBrush to create a gradient within a rectangle.

<Canvas xmlns="">
 <Rectangle Width="500" Height="500">
   <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
    <GradientStop Color="Purple" Offset="0.0" />
    <GradientStop Color="Red" Offset="0.25" />
    <GradientStop Color="Navy" Offset="0.50"/>
    <GradientStop Color="Yellow" Offset="0.75" />
    <GradientStop Color="Green" Offset="1.0" />
comments powered by Disqus
Upcoming Events

.NET Insight

Sign up for our newsletter.

I agree to this site's Privacy Policy.