<!-- BrushTypes.xaml
     Shows examples of several different brush types. TODO: scrollbar to see the whole example
     -->
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  Title="Different Types of Brushes">
  <Page.Resources>
    <Style TargetType="{x:Type Rectangle}">
      <Setter Property="Stroke" Value="Black"/>
      <Setter Property="StrokeThickness" Value="2"/>
      <Setter Property="Margin" Value="20"/>
      <Setter Property="VerticalAlignment" Value="Top"/>
    </Style>
    <Style TargetType="{x:Type Ellipse}">
      <Setter Property="Stroke" Value="Black"/>
      <Setter Property="StrokeThickness" Value="2"/>
      <Setter Property="Margin" Value="0,0,5,5"/>
    </Style>
  </Page.Resources>
  <StackPanel>


    <!-- <SnippetGraphicsMMSolidColorBrushExampleInline> -->
    <Rectangle Width="75" Height="75">
      <Rectangle.Fill>
        <SolidColorBrush Color="Red" />
      </Rectangle.Fill>
    </Rectangle>
    <!-- </SnippetGraphicsMMSolidColorBrushExampleInline> -->

    <!-- <SnippetGraphicsMMLinearGradientBrushExampleInline> -->
    <Rectangle Width="75" Height="75">
      <Rectangle.Fill>
        <LinearGradientBrush>
          <GradientStop Color="Yellow" Offset="0.0" />
          <GradientStop Color="Orange" Offset="0.5" />
          <GradientStop Color="Red" Offset="1.0" />
        </LinearGradientBrush>
      </Rectangle.Fill>
    </Rectangle>
    <!-- </SnippetGraphicsMMLinearGradientBrushExampleInline> -->

    <!-- <SnippetGraphicsMMRadialGradientBrushExampleInline> -->
    <Rectangle Width="75" Height="75">
      <Rectangle.Fill>
        <RadialGradientBrush GradientOrigin="0.75,0.25">
          <GradientStop Color="Yellow" Offset="0.0" />
          <GradientStop Color="Orange" Offset="0.5" />
          <GradientStop Color="Red" Offset="1.0" />
        </RadialGradientBrush>
      </Rectangle.Fill>
    </Rectangle>
    <!-- </SnippetGraphicsMMRadialGradientBrushExampleInline> -->

    <!-- <SnippetGraphicsMMImageBrushExampleInline> -->
    <Rectangle Width="75" Height="75">
      <Rectangle.Fill>
        <ImageBrush ImageSource="sampleImages\pinkcherries.jpg"  />
      </Rectangle.Fill>
    </Rectangle>
    <!-- </SnippetGraphicsMMImageBrushExampleInline> -->

    <!-- <SnippetGraphicsMMDrawingBrushExampleInline> -->
    <Rectangle Width="75" Height="75">
      <Rectangle.Fill>
        <DrawingBrush Viewport="0,0,0.25,0.25" TileMode="Tile">
          <DrawingBrush.Drawing>
            <DrawingGroup>
              <GeometryDrawing Brush="White">
                <GeometryDrawing.Geometry>
                  <RectangleGeometry Rect="0,0,100,100" />
                </GeometryDrawing.Geometry>
              </GeometryDrawing>

              <GeometryDrawing>
                <GeometryDrawing.Geometry>
                  <GeometryGroup>
                    <RectangleGeometry Rect="0,0,50,50" />
                    <RectangleGeometry Rect="50,50,50,50" />
                  </GeometryGroup>
                </GeometryDrawing.Geometry>
                <GeometryDrawing.Brush>
                  <LinearGradientBrush>
                    <GradientStop Offset="0.0" Color="Black" />
                    <GradientStop Offset="1.0" Color="Gray" />
                  </LinearGradientBrush>
                </GeometryDrawing.Brush>
              </GeometryDrawing>
            </DrawingGroup>
          </DrawingBrush.Drawing>
        </DrawingBrush>
      </Rectangle.Fill>
    </Rectangle>
    <!-- </SnippetGraphicsMMDrawingBrushExampleInline> -->

    <!-- <SnippetGraphicsMMVisualBrushExampleInline> -->
    <Rectangle Width="75" Height="75">
      <Rectangle.Fill>
        <VisualBrush TileMode="Tile">
          <VisualBrush.Visual>
            <StackPanel>
              <StackPanel.Background>
                <DrawingBrush>
                  <DrawingBrush.Drawing>
                    <GeometryDrawing>
                      <GeometryDrawing.Brush>
                        <RadialGradientBrush>
                          <GradientStop Color="MediumBlue" Offset="0.0" />
                          <GradientStop Color="White" Offset="1.0" />
                        </RadialGradientBrush>
                      </GeometryDrawing.Brush>
                      <GeometryDrawing.Geometry>
                        <GeometryGroup>
                          <RectangleGeometry Rect="0,0,50,50" />
                          <RectangleGeometry Rect="50,50,50,50" />
                        </GeometryGroup>
                      </GeometryDrawing.Geometry>
                    </GeometryDrawing>
                  </DrawingBrush.Drawing>
                </DrawingBrush>
              </StackPanel.Background>
              <TextBlock FontSize="10pt" Margin="10">Hello, World!</TextBlock>
            </StackPanel>
          </VisualBrush.Visual>
        </VisualBrush>
      </Rectangle.Fill>
    </Rectangle>
    <!-- </SnippetGraphicsMMVisualBrushExampleInline> -->

  </StackPanel>
</Page>
