Confused by the behavior of Dispatcher.BeginInvoke()

后端 未结 2 427
时光取名叫无心
时光取名叫无心 2021-01-17 18:53

Could someone shed some light on an issue I\'m having?

I\'m working on a wpf project. The scenario is as below:

I need to pop up a window(model window) on ma

2条回答
  •  难免孤独
    2021-01-17 19:20

    BeginInvoke is a non-blocking method; it adds the action to the dispatcher queue, and doesn't wait for its completion. You should use Invoke instead, which calls the method synchronously on the dispatcher thread.

提交回复
热议问题