title: Change text by second class
body: <p>I'm trying to learn c# at the momemnt.</p>
  
  <p>My problem is:</p>
  
  <p>I have 2 classes. <code>MainWindow.xaml.cs</code> for the UI and another one called <code>dosomething.cs</code>.</p>
  
  <p>If a button on the UI is clicked a method from <code>dosomething.cs</code> should be called. That just works fine. I want that <code>dosomething.cs</code> while running the click-handler (takes some time) tell the actual state to the UI.</p>
  
  <pre><code>status_textblock = "test";
  for (int i = 1; i&lt;1000000; i++)
  i += i;
  Thread.sleep(100);
  Status_textblock = i.tostring();
  }
  </code></pre>
  
  <p>What do I have to do that every new value immediately appears in the UI? I already tried <code>Backgroundworker</code> and <code>Dispatcher</code> with no success.</p>