title: How to execute wait time on a seperate thread to stop UI from freezing
body: <p>I'm trying to increment the floor, and every time the status of the floor should change and show on the floor slowly increasing to the desired floor. But the floor just waits then jumps straight to he desired floor without me seeing it gradually increment. I'm assuming it's because the UI is frozen every time it hits sleep and therefore I don't see the gradual incrementing.</p>
  
  <p>So how do I execute the wait on another thread (if thats even the problem) to stop the UI from not freezing?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>        while (floor &gt; elevator.currentFloor)
          {
              elevator.currentFloor++;
              changeStatus(elevator);
              currentFloorLbl.Text = "Current Floor: " + elevator.currentFloor;
              System.Threading.Thread.Sleep(500);
          }
  </code></pre>