title: Wpf - Using Shapes as a Resource
body: <p>Iv'e got a Rectangle in my resource dictionary which i would like to place inside numerous Grid objects  </p>
  
  <pre><code>&lt;Rectangle  HorizontalAlignment="Left" Width="10" x:Key="ShadowRect"&gt;
      &lt;Rectangle.Fill&gt;
          &lt;LinearGradientBrush EndPoint="1.7,0.603" StartPoint="0.3,0.603"&gt;
              &lt;GradientStop Color="White" Offset="1"/&gt;
          &lt;GradientStop Color="Black" Offset="0.009"/&gt;                    
           &lt;/LinearGradientBrush&gt;
      &lt;/Rectangle.Fill&gt;                               
   &lt;/Rectangle&gt;
  </code></pre>
  
  <p>Now of course i could place it directly like so :</p>
  
  <pre><code> &lt;Grid&gt;
       &lt;Rectangle  HorizontalAlignment="Left" Width="10" &gt;
          &lt;Rectangle.Fill&gt;
            &lt;LinearGradientBrush EndPoint="1.7,0.603" StartPoint="0.3,0.603"&gt;
                &lt;GradientStop Color="White" Offset="1"/&gt;
            &lt;GradientStop Color="Black" Offset="0.009"/&gt;                  
             &lt;/LinearGradientBrush&gt;
           &lt;/Rectangle.Fill&gt;                              
       &lt;/Rectangle&gt;
   &lt;/Grid&gt;
  </code></pre>
  
  <p>but i would like to use it as a Resource so i do not have to write this XAML for every Grid ,</p>
  
  <p>how can i place the rectangle using it's resource key ?</p>