following:
<Canvas
xmlns='http://schemas.microsoft.com/client/2007'
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
</Canvas>
Reload Default.html
in the web browser. Figure 19-9 shows the output.

Figure 19-9
A <Polygon>
element draws a shape with arbitrary number of sides. Edit UI.xaml
again, replacing its content with the following:
<Canvas
xmlns='http://schemas.microsoft.com/client/2007'
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
</Canvas>
Reload Default.html
in the web browser to see the result (see Figure 19-10).

Figure 19-10
A <Polyline>
element draws a series of connected lines. Edit the UI.xaml
file and replace its content with the following:
<Canvas
xmlns='http://schemas.microsoft.com/client/2007'
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
</Canvas>
Reload Default.html
in the web browser, and observe the output (see Figure 19-11).

Figure 19-11
The Fill
attribute that you have seen in many of the previous examples fills (paints) a shape with a solid color. However, the fill is not restricted to solid colors. Silverlight supports various ways to paint a shape:
□ SolidColorBrush
□ LinearGradientBrush
□ RadialGradientBrush
□ ImageBrush
The <SolidColorBrush>
element paints an area with a solid color. Edit the UI.xaml
file created in the previous section, and replace its content with the following:
<Canvas
xmlns='http://schemas.microsoft.com/client/2007'
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
</Canvas>
In this example, the Fill
attribute specifies the solid color to use to fill up the particular element. Reload the Default.html
file in the web browser, and observe the output in your browser (see Figure 19-12).

Figure 19-12
The LinearGradientBrush
element paints an area with a linear gradient. Edit the UI.xaml
file again, replacing its content with the following:
<Canvas
xmlns=http://schemas.microsoft.com/client/2007
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>