title: Draw XAML shapes to DrawingContext?
body: <p>I have several common symbols that have been composed of WPF shape primatives (e.g. Rectangle, Line, Path etc). These symbols are currently stored in xaml files as user controls. For example:</p>
  
  <pre><code>&lt;Canvas x:Name="Symbol" Width="100" Height="100"&gt;
      &lt;Rectangle x:Name="Rectangle" Width="100" Height="100" Stretch="Fill"&gt;
          &lt;Rectangle.Fill&gt;
              &lt;SolidColorBrush Color="Aqua"&gt;&lt;/SolidColorBrush&gt;
          &lt;/Rectangle.Fill&gt;
      &lt;/Rectangle&gt;
  &lt;/Canvas&gt;
  </code></pre>
  
  <p>The above is a simple example but most of my symbols are more complex and composed of many different parts. So, I was hoping to use these user controls to store the symbols and make them easy to manipulate.</p>
  
  <p>I am doing quite a bit of drawing in the OnRender method of a Canvas and would like to include some of these composite symbols in my drawing. Is it possible get these into a format to draw them to the DrawingContext? I am aware that there is a method called DrawingContext.DrawImage but this takes an ImageSource as input.</p>
  
  <p>Any ideas would be much appreciated.</p>
  
  <p>Thanks,
  Alan</p>