title: Setting Path.Data in code-behind
body: <p>I have this XAML code which makes a <code>Path</code> which is inside a <code>Canvas</code> residing in a MainPage.xaml page.</p>
  
  <pre><code>&lt;Path x:Name="progressPath" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Stroke="Gold" StrokeThickness="5"
          Canvas.Left="300" Canvas.Top="300" Height="305" Width="305"
          Data="m 150,0 A 150,0 0 0 0 150,0 A 150,150 0 0 0 150,0"&gt;
      &lt;/Path&gt;
  </code></pre>
  
  <p>I want to have several <code>Path</code>'s like this one (for example, a new <code>Path</code> is made when the user taps a button), so I decided to create them in the code-behind - which doesn't seem to be possible.</p>
  
  <p>The <code>Path</code>'s  <code>Data</code> is populated with the <a href="https://msdn.microsoft.com/en-us/library/dn535793.aspx" rel="nofollow noreferrer">move and draw commands</a> syntax which cannot directly be used as a text value (as shown above) in code-behind like it can be in xaml - I've found <a href="https://stackoverflow.com/questions/3493163/define-the-path-data-from-code-behind-in-silverlight">workarounds for this</a> in Silverlight and I tried the same technique in my Metro/Windows-Store app but though it compiles correctly there is no <code>Path</code> on the screen.</p>
  
  <hr>
  
  <p><strong>tl;dr</strong> How do I create this <code>Path</code> in code-behind with the <code>Data</code> being as shown ?</p>