Tuesday, February 9, 2010

Add a gradient background to your DataForm

While the default DataForm in Silverlight 3 looks pretty good. You can add some flare to it by changing the background from solid color to a gradient of blue. You do so by adding the Background tag to your XAML for your DataForm.

<dataFormToolkit:DataForm >
<dataFormToolkit:DataForm.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFE8F3FC" Offset="0"/>
<GradientStop Color="#FF9BCCEE" Offset="0.108"/>
</LinearGradientBrush>
</dataFormToolkit:DataForm.Background>
</dataFormToolkit:DataForm>
 
Here is an example of what it would look like.

 
I snagged it from this very nice tutorial on DataForms.

No comments: