title: Alternative for Task.Wait in UI thread
body: <p>I know it is bad to call <code>Task.Wait</code> in UI thread. It causes a deadlock. Please refer to </p>
  
  <p><a href="http://social.msdn.microsoft.com/Forums/en/winappswithcsharp/thread/0d24419e-36ad-4157-abb5-3d9e6c5dacf1">Constructor invoke async method</a></p>
  
  <p><a href="http://blogs.msdn.com/b/pfxteam/archive/2011/01/13/10115163.aspx">Await, and UI, and deadlocks! Oh my!</a></p>
  
  <p>Take the following code:</p>
  
  <pre><code>    public MainPage()
      {
          this.InitializeComponent();
  
          step0();
          step1();
      }
  
      private async Task step0()
      {
          await Task.Delay(5000);
          System.Diagnostics.Debug.WriteLine("step 0");
      }
  
      private async Task step1()
      {
          await Task.Delay(3000);
          System.Diagnostics.Debug.WriteLine("step 1");
      }
  }
  </code></pre>
  
  <p>How can I ensure that "step 0" is always being printed before "step 1"? Using <code>Task.Wait</code> would cause deadlock. <strong>This is Windows Store App</strong></p>