<Page
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  x:Class="Microsoft.Samples.BrushExamples.TileSizeIllustration"
  WindowTitle="Tiling Example"
  Background="White" >
  
  <StackPanel Orientation="Vertical" Margin="20">



  <Rectangle
    Height="200" Width="200"
    Stroke="Black" StrokeThickness="2"
    >
    <Rectangle.Fill>
      <DrawingBrush Viewbox="25,25,25,25" ViewboxUnits="Absolute"
        Viewport="0,0,0.5,0.5" TileMode="Tile" Stretch="Fill"
        Drawing="{StaticResource TestPatternDrawing}" />
    </Rectangle.Fill>
  </Rectangle>



  <Rectangle
    Height="200" Width="200"
    Stroke="Black" StrokeThickness="2"
    >
    <Rectangle.Fill>
      <ImageBrush Viewbox="25,25,25,25" ViewboxUnits="Absolute"
        Viewport="0,0,0.5,0.5" TileMode="Tile" Stretch="Fill"
        ImageSource="sampleImages\cherries_larger.jpg" />
    </Rectangle.Fill>
  </Rectangle>


    <TextBlock Margin="0,10,0,0" Foreground="White">Relative Viewport Units: <Bold>0,0,0.25,0.25</Bold></TextBlock>
    <StackPanel Orientation="Horizontal">

      <Border BorderBrush="Black" BorderThickness="1" 
        Margin="0,0,10,0" VerticalAlignment="Top">
        <Rectangle
         Width="50" Height="100">
          <Rectangle.Fill>
            <ImageBrush ImageSource="sampleImages\cherries_larger.jpg"
              Viewport="0,0,0.5,0.5"
              TileMode="Tile" />
          </Rectangle.Fill>
        </Rectangle>
      </Border>

      <Border BorderBrush="Black" BorderThickness="1" 
        Margin="0,0,10,0" VerticalAlignment="Top">
        <Rectangle
         Width="200" Height="100">
          <Rectangle.Fill>
            <ImageBrush  ImageSource="sampleImages\cherries_larger.jpg"
              Viewport="0,0,0.5,0.5"
              TileMode="Tile" />
          </Rectangle.Fill>
        </Rectangle>
      </Border>

      <Border BorderBrush="Black" BorderThickness="1" 
        Margin="0,0,10,0" VerticalAlignment="Top">
        <Rectangle
         Width="200" Height="200">
          <Rectangle.Fill>
            <ImageBrush ImageSource="sampleImages\cherries_larger.jpg"
              Viewport="0,0,0.5,0.5"
              TileMode="Tile" />
          </Rectangle.Fill>
        </Rectangle>
      </Border>

    </StackPanel>

    <TextBlock Margin="0,10,0,0" Foreground="White">Absolute Viewport Units: <Bold>0,0,25,25</Bold></TextBlock>
    <StackPanel Orientation="Horizontal">


      <Border BorderBrush="Black" BorderThickness="1" 
        Margin="0,0,10,0" VerticalAlignment="Top">
        <Rectangle
         Width="50" Height="100">
          <Rectangle.Fill>
            <ImageBrush ImageSource="sampleImages\cherries_larger.jpg"
              Viewport="0,0,25,25"
              ViewportUnits="Absolute" 
              TileMode="Tile" />
          </Rectangle.Fill>
        </Rectangle>
      </Border>

      <Border BorderBrush="Black" BorderThickness="1" 
        Margin="0,0,10,0" VerticalAlignment="Top">
        <Rectangle
         Width="200" Height="100">
          <Rectangle.Fill>
            <ImageBrush ImageSource="sampleImages\cherries_larger.jpg"
              Viewport="0,0,25,25"
              ViewportUnits="Absolute" 
              TileMode="Tile" />
          </Rectangle.Fill>
        </Rectangle>
      </Border>

      <Border BorderBrush="Black" BorderThickness="1" 
        Margin="0,0,10,0" VerticalAlignment="Top">
        <Rectangle
         Width="200" Height="200">
          <Rectangle.Fill>
            <ImageBrush ImageSource="sampleImages\cherries_larger.jpg"
              Viewport="0,0,25,25"
              ViewportUnits="Absolute" 
              TileMode="Tile" />
          </Rectangle.Fill>
        </Rectangle>
      </Border>

    </StackPanel>
    
    
    
  </StackPanel>
</Page>
