Alternative for Task.Wait in UI thread
问题 I know it is bad to call Task.Wait in UI thread. It causes a deadlock. Please refer to Constructor invoke async method Await, and UI, and deadlocks! Oh my! Take the following 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"); } } How can I ensure that "step 0" is always