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.

378<br />

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

You can see how this is rendered in Figure 16-2.<br />

Figure 16-2. Using ZIndex to fine-tune your UI<br />

Also note that a Canvas may contain another Canvas, <strong>and</strong> that each Canvas can contain<br />

multiple controls, giving you complete creative control over how your UI is laid out.<br />

Using Brushes in XAML<br />

XAML uses brushes to define how shapes will be drawn <strong>and</strong> filled. The earlier example<br />

showed rectangles that were filled with white <strong>and</strong> black <strong>and</strong> outlined in black. These were<br />

simple examples of using brushes to set the fill (how a shape is painted) <strong>and</strong> the stroke<br />

(how a shape is outlined). In this case, you filled the rectangles with a solid color, but<br />

there are other options. These are as follows:<br />

SolidColorBrush: This paints with a solid color.<br />

LinearGradientBrush: This paints with a linear gradient defined in two-dimensional<br />

space.<br />

RadialGradientBrush: This paints with a circular (radial) gradient.

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

Saved successfully!

Ooh no, something went wrong!