title: How to use Thread.Sleep in WPF application?
body: <p>In a WPF application VS 2010, I basically need to print a document and check for errors after few seconds it start to print.</p>
  
  <p>At the moment I am using <code>Thread.Sleep(2000)</code> but it does not work. The <code>try</code> code I believe is running in the UI thread.</p>
  
  <p>Any idea how to fix it? Or better approach?</p>
  
  <p>In this specific case I do not care if the UI Thread is blocked for few seconds.</p>
  
  <pre><code>try
  {
      printer = new Printer();
      printer.PrintTicket(dataAdv);
      // check eventual problem during printing like paper jamp
      Thread.Sleep(2000);
      if (monitorPrinter.IsPrinterReady() == false)
      {
          isPrinterReady = false;
          MessageBox.Show("Problem during the printing!!!");
      }
  }
  </code></pre>