title: How to make a child thread sleep without freezing UI thread in WPF application?
body: <p>I have a WPF application and I have individual threads running to accomplish tasks and I would like to have the current thread to go to sleep something like,</p>
  
  <blockquote>
    <p>Thread.CurrentThread.Sleep(10000)</p>
  </blockquote>
  
  <p>I do see it in Java but not in C#. I do know that I only have only one UI thread, so if I use Thread.Sleep(10000) my UI thread will be block. I am using async and await from .NET 4.5.</p>
  
  <blockquote>
    <p>var words = await Task.Factory.StartNew(() => { 
    StringMgr.TextToUniqueWords(File.ReadAllText(filename)); </p>
    
    <p>// I want to be able to sleep this thread for 10 seconds, without the UI freezing</p>
    
    <p>});</p>
  </blockquote>
  
  <p>So how do I put a child thread to sleep without freezing the UI thread in a WPF application?</p>
  
  <p>Thanks!</p>