<Rectangle Margin="10">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="Red" Offset="0" />
<GradientStop Color="Yellow" Offset="0.25" />
<GradientStop Color="Green" Offset="0.5" />
<GradientStop Color="Blue" Offset="0.75" />
<GradientStop Color="Purple" Offset="1" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>