Dispatcher.BeginInvoke not being executed in one case

倖福魔咒の 提交于 2019-12-01 23:45:37

Just to make my comments "official". This might be caused by calling the Dispatcher.CurrentDispatcher from another thread. That can cause the application to create a new dispatcher that doesn't have any access to the UI.

Assuming that you're creating the ErgaenzungsfeldService class from the UI, you can create a readonly Dispatcher field that has the value of Dispatcher.CurrentDispatcher. This will give you the UI dispatcher.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!