title: TextBlock TextWrapping not wrapping
body: <p>When I place a TextBlock inside of a Horizontally Aligned StackPanel it does not wrap. I realize that this is because the available width of the StackPanel is PositiveInfinity but are there any workarounds?</p>
  
  <p>My layout is much more complicated than this sample so I cannot remove the StackPanel or 
  the Horizontal Orientation. I just tried to reproduce the simplest possible example that exhibits the behavior.</p>
  
  <pre><code>    &lt;StackPanel Orientation="Horizontal"&gt;
          &lt;Rectangle Width="50" Height="50" Fill="Blue" VerticalAlignment="Top" /&gt;
          &lt;Rectangle Width="50" Height="50" Fill="Red" VerticalAlignment="Top" /&gt;
          &lt;TextBlock TextWrapping="Wrap"
                  Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus leo lectus, viverra ut lobortis vel, mollis eget lectus. Suspendisse laoreet consequat ultrices. Curabitur ultricies, tortor feugiat porttitor faucibus, lorem eros pretium nisl, eu ullamcorper mauris tortor sit amet augue." /&gt;
      &lt;/StackPanel&gt;
  </code></pre>
  
  <p><strong>Update:</strong> The width of the TextBlock must be dynamic. I need it to flow with the window as it is resized.</p>
  
  <p><strong>Update 2:</strong> Added another element to the StackPanel because I need the children laid out Horizontally.</p>
  
  <p><strong>Update 3 (Solution):</strong> Replaced the StackPanel with a DockPanel.</p>
  
  <pre><code>&lt;DockPanel&gt;
      &lt;DockPanel DockPanel.Dock="Top"&gt;
          &lt;Rectangle Width="50" Height="50" Fill="Blue" VerticalAlignment="Top" DockPanel.Dock="Left" /&gt;
          &lt;Rectangle Width="50" Height="50" Fill="Red" VerticalAlignment="Top" DockPanel.Dock="Left" /&gt;
          &lt;TextBlock TextWrapping="Wrap"
                  Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus leo lectus, viverra ut lobortis vel, mollis eget lectus. Suspendisse laoreet consequat ultrices. Curabitur ultricies, tortor feugiat porttitor faucibus, lorem eros pretium nisl, eu ullamcorper mauris tortor sit amet augue." /&gt;
      &lt;/DockPanel&gt;
  &lt;/DockPanel&gt;
  </code></pre>