title: C# WPF - ScrollViewer + TextBlock troubles
body: <p>I have a <code>TextBlock</code> within a <code>ScrollViewer</code> that aligns with stretch to its window.  I need the <code>TextBlock</code> to behave as the following:</p>
  
  <ul>
  <li>Resizes with window, no scrollbars</li>
  <li>When resized below a certain width the <code>TextBlock</code> needs to keep a <code>MinWidth</code>  and scrollbars should appear</li>
  <li><code>TextWrapping</code> or <code>TextTrimming</code> should work appropriately</li>
  </ul>
  
  <p>How can I get this functionality?</p>
  
  <p>I have tried several ways, involving bindings to <code>ActualWidth</code> &amp; <code>ActualHeight</code>, but can't get it to work.</p>
  
  <p>This can't be that difficult, what am I missing?</p>
  
  <p>Here is a code sample to put in XamlPad (no MinWidth is set yet):</p>
  
  <pre><code>&lt;Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
      &lt;ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"&gt;
              &lt;TextBlock TextWrapping="Wrap" Text="Some really long text that should probably wordwrap when you resize the window." /&gt;
      &lt;/ScrollViewer&gt;
  &lt;/Window&gt;
  </code></pre>