title: How to get a WPF TextBlock to scroll where the Text property is set asynchronously?
body: <p>I have a <code>TextBlock</code>, wrapped in a <code>ScrollViewer</code>, and the <code>Text</code> property of the <code>TextBlock</code> is set with the result of a Task. The scrollbars of the <code>TextBlock</code> do not adjust to the size of the text returned by the task.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>&lt;Grid&gt;
     &lt;Grid.ColumnDefinitions&gt;
        &lt;ColumnDefinition Width="500"/&gt;
     &lt;/Grid.ColumnDefinitions&gt;
  
     &lt;ScrollViewer VerticalScrollBarVisibility="Auto" 
                   Height="177" 
                   Width="500" 
                   HorizontalScrollBarVisibility="Disabled"&gt;
        &lt;TextBlock Height="177" 
                  Text="Extracted Xml" 
                  Width="504" 
                  HorizontalAlignment="Stretch" 
                  TextWrapping="Wrap" /&gt;
     &lt;/ScrollViewer&gt;
  &lt;/Grid&gt;
  </code></pre>