Rectangle.Fill with ImageBrush

   
      
<Page  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
   x:Class="Microsoft.Samples.Graphics.UsingImageBrush.TilingExample" >

  <Grid Margin="20">

    <Rectangle
      Grid.Row="3" Grid.Column="0"
      Width="300" Height="150"
      Stroke="MediumBlue" StrokeThickness="1"
      HorizontalAlignment="Left">
      <Rectangle.Fill>
        <ImageBrush Stretch="None"  ImageSource="c:image.jpg"  />
      </Rectangle.Fill>
    </Rectangle>

  </Grid>
</Page>

   
    
    
    
    
    
     


Trigger animation with Rectangle.MouseLeave


   
     
<Window x:Class="Main"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="" Height="300" Width="300">
  <Grid>
    <Rectangle Height="100" Width="100" Fill="Firebrick" Stroke="Black" StrokeThickness="1">
      <Rectangle.Style>
        <Style TargetType="Rectangle">
          <Style.Triggers>
            <EventTrigger RoutedEvent="Rectangle.MouseLeave">
              <BeginStoryboard>
                <Storyboard>
                  <ParallelTimeline>
                    <DoubleAnimation Storyboard.TargetProperty="Width" To="100" />
                    <DoubleAnimation Storyboard.TargetProperty="Height" To="100" />
                    <ColorAnimation Storyboard.TargetProperty="Fill.Color" To="Red" />
                  </ParallelTimeline>
                </Storyboard>
              </BeginStoryboard>
            </EventTrigger>
          </Style.Triggers>
        </Style>
      </Rectangle.Style>
    </Rectangle>
  </Grid>
</Window>

   
    
    
    
    
     


Trigger animation with Rectangle.MouseEnter


   
     
<Window x:Class="Main"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="" Height="300" Width="300">
  <Grid>
    <Rectangle Height="100" Width="100" Fill="Firebrick" Stroke="Black" StrokeThickness="1">
      <Rectangle.Style>
        <Style TargetType="Rectangle">
          <Style.Triggers>
            <EventTrigger RoutedEvent="Rectangle.MouseEnter">
              <BeginStoryboard>
                <Storyboard>
                  <ParallelTimeline RepeatBehavior="Forever" AutoReverse="True">
                    <DoubleAnimation Storyboard.TargetProperty="Width" To="150" />
                    <DoubleAnimation Storyboard.TargetProperty="Height" To="150" />
                    <ColorAnimation Storyboard.TargetProperty="Fill.Color" To="Orange" />
                  </ParallelTimeline>
                </Storyboard>
              </BeginStoryboard>
            </EventTrigger>
          </Style.Triggers>
        </Style>
      </Rectangle.Style>
    </Rectangle>
  </Grid>
</Window>

   
    
    
    
    
     


A rectangle with a rotate transformation


   
     
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:sys="clr-namespace:System;assembly=mscorlib" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
  <Grid>

    <Rectangle Height ="100" Width ="40" Fill ="Red" Grid.Row="0" Grid.Column="0">
      <Rectangle.LayoutTransform>
        <RotateTransform Angle ="45"/>
      </Rectangle.LayoutTransform>
    </Rectangle>

  </Grid>

</Window>

   
    
    
    
    
     


Rounded Rectangle Corner radius of 100 (X) and 60 (Y)


   
     

<Window x:Class="Drawing.RoundedRectangles"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="RoundedRectangles" Height="449" Width="340"
    >
  <StackPanel>


    <TextBlock Margin="5,5,0,0">Corner radius of 100 (X) and 60 (Y).</TextBlock>
    <Rectangle Fill="Yellow" Stroke="Blue" RadiusX="100" RadiusY="60"
               Width="100" Height="60" Margin="5"  HorizontalAlignment="Left"></Rectangle>
  </StackPanel>
</Window>

   
    
    
    
    
     


Rounded Rectangle Corner radius of 10 (X) and 25 (Y)


   
     

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="Microsoft.Samples.Graphics.RectangleExample"
    WindowTitle="Example">
  <Canvas>
  <TextBlock Margin="5,5,0,0">Corner radius of 10 (X) and 25 (Y).</TextBlock>
    <Rectangle Fill="Yellow" Stroke="Blue" RadiusX="10" RadiusY="25"
               Width="100" Height="60" Margin="5"  HorizontalAlignment="Left"></Rectangle>

  </Canvas>
</Page>