title: Adding a line to a textblock programmatically
body: <p>I know how to add a control to the canvas/grid/layout- simply by calling <code>canvas.Childern.Add()</code>. However, when I want to embed something inside a textblock, I can't seem to find the method for it. A textblock doesn't contain a <code>Add</code> method or anything, so I'm at a bit of a lost.</p>
  
  <p>The XAML I'm trying to turn into C# is:</p>
  
  <pre><code>&lt;TextBlock x:Name="textBlock"&gt;
      &lt;Line X1="0" Y1="0" X2="100" Y2="0" Stroke="Black" StrokeThickness="4" x:Name="line1"/&gt;
      &lt;TextBlock Text="Hello there!" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="innerTextBlock" /&gt;
      &lt;Line X1="0" Y1="0" X2="100" Y2="0" Stroke="Black" StrokeThickness="4" x:Name="line2"/&gt;
  &lt;/TextBlock&gt;
  </code></pre>
  
  <p>EDIT: I think the best way to do it (besides the answer) is to simply create a WPF User control and reference that.</p>