In a Silverlight application, Create a resource in App.xaml. Something like this…
<Application.Resources>
<RadialGradientBrush x:Key="GreenRadialBrush" >
<GradientStop Color="DarkGreen" Offset="0" />
<GradientStop Color="White" Offset="1" />
</RadialGradientBrush>
<LinearGradientBrush x:Key="SampleLinearBrush" >
<GradientStop Color="#443344" Offset="0" />
<GradientStop Color="#778899" Offset="1" />
</LinearGradientBrush>
</Application.Resources>
Go back to mainpage.xaml and draw a rectangle or any control for that matter. Switch to properties for the control and look for Fill (or Brushes -> Fill). Right click on Fill and select Apply Resource
Notice, how it shows all the Resources and the preview as a swatch!
Cheers,
Rahul
Quote of the day:
The scientific theory I like best is that the rings of Saturn are composed entirely of lost airline luggage. - Mark Russell