08.01.2015 Views

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

382<br />

CHAPTER 16 ■ PROGRAMMING SILVERLIGHT WITH XAML AND JAVASCRIPT<br />

of the rectangle bounding the circle, <strong>and</strong> (0,0) is the upper left-h<strong>and</strong> side of the rectangle<br />

bounding the circle.<br />

Here’s an example of the GradientOrigin being set to (0.2,0.2):<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

The SpreadMethod allows you to determine how the gradient repeats. It can be set<br />

to one of three values: Pad is the default, <strong>and</strong> it means that the gradient fades evenly<br />

between colors, <strong>and</strong> that the bounding rectangle is filled with the last color on the gradient;<br />

Reflect means that once the gradient is filled, it is reversed to fill in the remainder;<br />

<strong>and</strong> Repeat means that once the gradient is filled, it is repeated. These are particularly<br />

useful when used in combination with the RadiusX <strong>and</strong> RadiusY properties.<br />

Here’s an example of a RadialGradientBrush using the Reflect value in the<br />

SpreadMethod:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

RadiusX <strong>and</strong> RadiusY are used to set the desired radius of the gradient. The default<br />

value of this is 0.5, so specifying a value less than this will mean that multiple gradients<br />

will be used in the fill. This is probably best shown by example:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!