title: WPF TextBox getting cut off
body: <p>For some strange reason my WPF textbox which is embedded in a scroll viewer get abruptly cut off like in the image below after I have added a lot of text to it. Is there some limit or something that is reached that I can make larger or something?</p>
  
  <p><img src="https://i.stack.imgur.com/qrzG0.png" alt="enter image description here"></p>
  
  <p>I do not receive any error messages.</p>
  
  <p>Here is the relevant Xaml:</p>
  
  <pre><code>&lt;Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"&gt;
          &lt;Button x:Name="Slice_Button" Content="Slice" HorizontalAlignment="Left" Margin="106,0,0,0" VerticalAlignment="Top" Click="Slice_Button_Click" Height="87" Background="#FF0D5B1E"/&gt;
          &lt;Button x:Name="CancelButton" Content="Cancel" HorizontalAlignment="Left" Margin="232,0,0,0" VerticalAlignment="Top" Height="87" Click="Button_Click_1" Background="#FFC70E0E"/&gt;
          &lt;ScrollViewer x:Name="Scroller" HorizontalAlignment="Left" Height="505" Margin="10,92,0,0" VerticalAlignment="Top" Width="436"&gt;
              &lt;TextBox x:Name="OutBox" TextWrapping="Wrap" Text="Output will be displayed here" IsReadOnly="True" Margin="2"/&gt;
          &lt;/ScrollViewer&gt;
  
      &lt;/Grid&gt;
  </code></pre>
  
  <p>Here is the C# I use to add the text:</p>
  
  <pre><code>main.DispatchInvoke(() =&gt;
              {
                  main.OutBox.Text += newText;
                  main.Scroller.ScrollToVerticalOffset(main.Scroller.ScrollableHeight);
                  main.Scroller.UpdateLayout();
              });
  </code></pre>