MessageDialog task not shown if i use Task.Wait() instead of await

前端 未结 2 1302
迷失自我
迷失自我 2021-01-22 19:33

I don\'t know the difference beetween await a task and use task.Wait() but for the MessageDialog.ShowAsync method with the first it works but not with the second (while the two

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-22 20:14

    task.Wait() blocks until the task is complete, while await continues processing. My guess is that because the UI is blocked, the message dialog cannot appear.

提交回复
热议问题