title: How to append text to TextBlock in loop immediatelly?
body: <p>I'm new WPF.</p>
  
  <p>I'm trying to print some information in my WPF application. I wrote simple method that appends text to <code>TextBlock</code> called <code>tbLog</code> and I want to use it like console output.</p>
  
  <pre><code>private void WriteLn(string text)
  {
      tbLog.Text += text + Environment.NewLine; // tbLog is a TextBlock
  }
  </code></pre>
  
  <p>Now I'm trying to use it in a loop.</p>
  
  <pre><code>foreach (var day in listOfDays)
  {
      Stopwatch watch = new Stopwatch();
      watch.Start();
      double[] aData = GetDayData(data, day); // I'm using EF6 DbContext here
      alData.Add(aData); 
      WriteLn("Processing " + day.Date.Date + " took " + watch.Elapsed.TotalSeconds + "s");
  }
  </code></pre>
  
  <p><strong>Effect of <code>WriteLn()</code> is not visible immediatelly (after each loop run). All printed data shows up after whole loop ends.
  How can I fix that?</strong></p>
  
  <p>My <code>GetDayData()</code> method used in a loop uses Entity Framework 6 <code>DbContext</code>.</p>