title: WPF C# Path: How to get from a string with Path Data to Geometry in Code (not in XAML)
body: <p>I want to generate a WPF Path object in Code.</p>
  
  <p>In XAML I can do this:</p>
  
  <pre><code> &lt;Path Data="M 100,200 C 100,25 400,350 400,175 H 280"&gt;
  </code></pre>
  
  <p>How can I do the same in Code?</p>
  
  <pre><code> Path path = new Path();
   Path.Data = "foo"; //This won't accept a string as path data.
  </code></pre>
  
  <p>Is there a class/Method available that converts the string with PathData to PathGeometry or similar? </p>
  
  <p>Surely somehow the XAML gets parsed and the Data-string converted?</p>