title: WPF Textbox Element freezes when setting the text property to a large string
body: <p>I am currently developing an UWP app and I encountered a problem with the
  TextBox WPF Element, which seems to have terrible performance when dealing with larger texts. Pasting a large text from the clipboard into the textbox works perfectly fine, but when I try to set the text programmatically it freezes the entire application:</p>
  
  <pre class="lang-cs prettyprint-override"><code>textbox.Text = sb.ToString(); //Freezes or takes for ever
  </code></pre>
  
  <p>This is how I defined the textbox in my MainPage.xaml:
  </p>
  
  <pre><code>&lt;TextBox x:Name="textbox" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ScrollViewer.VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" Margin="0,0,0,70"/&gt;
  </code></pre>
  
  <p>Does anyone know of a solution to this performance problem or are 
  there any alternative text field elements I could use?</p>