title: ScrollViewer and TextBlock wrapping
body: <p>I have the following layout (simplified):</p>
  
  <pre><code>&lt;Grid&gt;
    &lt;Grid.ColumnDefinitions&gt;
      &lt;ColumnDefinition MaxWidth="400" /&gt;
      &lt;ColumnDefinition /&gt;
    &lt;/Grid.ColumnDefinitions&gt;
  
    &lt;!-- Code for Column=0 --&gt;
  
    &lt;ScrollViewer Grid.Column="1"&gt;
      &lt;Grid x:Name="layoutGrid"&gt;
  
        &lt;Grid.ColumnDefinitions&gt;
          &lt;Grid.ColumnDefinition Width="Auto" /&gt;
          &lt;Grid.ColumnDefinition MinWidth="100" MaxWidth="400" /&gt;
          &lt;Grid.ColumnDefinition Width="Auto" /&gt;
        &lt;/Grid.ColumnDefinitions&gt;
  
        &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition /&gt;
          &lt;RowDefinition /&gt;
          &lt;RowDefinition /&gt;
        &lt;/Grid.RowDefinitions&gt;
  
  
        &lt;!-- Code for Row=0 and Row=1 --&gt;
  
        &lt;GroupBox Grid.ColumnSpan="3" Grid.Row=2&gt;
          &lt;TextBlock Text="{Binding ...}" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top" /&gt;
        &lt;/GroupBox&gt;
      &lt;/Grid&gt;
    &lt;/ScrollViewer&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <ul>
  <li>First column should occupy space as mush as it needs (sometimes it can be 100 pixels, sometimes 500).</li>
  <li>Second column Should stretch to available space, but no more than 400 pixels (gets ugly).</li>
  <li>Third column should occupy space as much as it needs (sometimes it can be 200 pixels, sometimes 400).</li>
  <li>If, in some rare cases, layoutGrid needs space more than available on the screen, horizontal scrollbar should be visible.</li>
  <li>GroupBox should always have the total width of all three columns (it should spread as much as their width is in total). And in that space, text box should wrap. GroupBox should not stretch to whole space available on screen.</li>
  </ul>
  
  <p>How can I achieve this in xaml? It seems that as soon as ScrollViewer is inserted, TextBlock does not wrap any more.</p>