title: How to copyclone a UIElement and keep the layout/render information?
body: <p>I wish to copy a complex data-bound <code>UIElement</code> but keep the Binding, Layout and Rendering information from the original UIElement. </p>
  
  <p>Creating a new <code>UIElement</code> seems inefficient since I would have to do another complete Binding/Measure/Arrange/Render pass.</p>
  
  <p>The closest I've got so far is to create a new <code>DrawingVisual</code>, open it for rendering, and DrawDrawing using the source UIElement <code>DrawingGroup</code>.</p>
  
  <pre><code>DrawingVisual dv = new DrawingVisual();
  DrawingGroup dg = VisualTreeHelper.GetDrawing(SourceElement);
  
  using (DrawingContext dc = dv.RenderOpen())
  {
       Drawing d = dg.Children[0];
       dc.DrawDrawing(d);
  }
  
  return dv;
  </code></pre>
  
  <p>Is this a good approach and will it work for complex UIElements (e.g. lots of Panels within Borders, custom Controls etc etc)?</p>
  
  <p>To give you a context, I am making a <code>DocumentPaginator</code> which is working well, but inefficeintly due to the recreation of identical UIElements.</p>
  
  <p>Thanks in advance,
  Pete</p>