<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

<!-- Example 13-52. Using DrawingBrush -->

<Rectangle Width="80" Height="30">
  <Rectangle.Fill>
    <DrawingBrush>
      <DrawingBrush.Drawing>
        <DrawingGroup>
          <DrawingGroup.Children>
            <GeometryDrawing>
              <GeometryDrawing.Brush>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                  <GradientStop Color="Green" Offset="0" />
                  <GradientStop Color="DarkGreen" Offset="1" />
                </LinearGradientBrush>
              </GeometryDrawing.Brush>

              <GeometryDrawing.Pen>
                <Pen Thickness="0.02">
                  <Pen.Brush>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                      <GradientStop Color="Black" Offset="0" />
                      <GradientStop Color="LightGray" Offset="1" />
                    </LinearGradientBrush>
                  </Pen.Brush>
                </Pen>
              </GeometryDrawing.Pen>
              <GeometryDrawing.Geometry>
                <RectangleGeometry RadiusX="0.2" RadiusY="0.5"
                                   Rect="0.02,0.02,0.96,0.96" />
              </GeometryDrawing.Geometry>
            </GeometryDrawing>

            <GeometryDrawing>
              <GeometryDrawing.Brush>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                  <GradientStop Color="#dfff" Offset="0" />
                  <GradientStop Color="#0fff" Offset="1" />
                </LinearGradientBrush>
              </GeometryDrawing.Brush>
              <GeometryDrawing.Geometry>
                <RectangleGeometry RadiusX="0.1" RadiusY="0.5"
                                   Rect="0.1,0.07,0.8,0.5" />
              </GeometryDrawing.Geometry>
            </GeometryDrawing>
          </DrawingGroup.Children>
        </DrawingGroup>
      </DrawingBrush.Drawing>
    </DrawingBrush>
  </Rectangle.Fill>
</Rectangle>

<!-- End of Example 13-52. -->

</Page>

