title: How to draw graphics as efficiently as possible in WPF
body: <p>I am creating a tool which relies heavily on graph-node trees. The current implementation is done in Java and I'm porting it to a generic code-base on C#, so it can be used by various rendering implementations and also because I want to use the power of WPF for a user-friendly interface.</p>
  
  <p>After browsing around for a day, I came across various methods to draw Vector-graphics through WPF.</p>
  
  <p><a href="http://www.fernicola.org/loquitor/index.php?/archives/17-WPF-Pick-Your-API-Abstraction.html" rel="noreferrer">This guy</a> speaks about different layers within WPF developers can choose from. As I want to use WPF PURELY for his rendering at first, I want to work on the "Visual Layer".</p>
  
  <p>I then came across things like:
  <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.drawingvisual.aspx" rel="noreferrer">DrawingVisual</a>,
  <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.geometrydrawing.aspx" rel="noreferrer">GeometryDrawing</a>,
  <a href="http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.aspx" rel="noreferrer">FrameworkElement</a> / <a href="http://msdn.microsoft.com/en-us/library/system.windows.uielement.aspx" rel="noreferrer">UIElement</a> / Shapes</p>
  
  <p>So, I'm a bit overwhelmed by all the different implementations that do eventually the same in totally different ways.</p>
  
  <p>The Graph-Node library has been ported to C# already with all it's logic (including collision detection and dragging with mouse). As it is made with graphic-renderers in mind (like XNA, SlimDX, OpenTK, etc.), what would be the best way in terms of performance to implement a WPF renderer (as in, it will draw whatever the graph library tells it to draw? </p>
  
  <p>Basically, the resulting WPF control acts as a canvas, but it has to be SUPER lightweight and not have any neat WPF features besides providing me a way to draw my circles, lines and other shapes :)</p>
  
  <p>EDIT:</p>
  
  <p>I basically want to know: What is the way to go? Do I extend Canvas as "Host" for my graphics and then add my custom implementation of a UIElement? Or can I have one class which can draw EVERYTHING (as in, one mega super ultra graphic). Much like overriding OnPaint in GDI or Paint-method in Java (which gives a Graphics object to do everything with).</p>