开发者

Getting WPF Dispatcher from library

Is there a way to get the GUI D开发者_如何学编程ispatcher from a library without passing reference from the GUI?

I'm working with a library (MVVM) that can invalidate datasources which will cause a GUI update. The Invalidate call needs to come from the GUI thread. I can just pass the reference, but it would be nice not to have to do that.


The GUI dispatcher for the library will be the same dispatcher for your application. Anything that needs to run on the UI thread can just be called with Application.Current.Dispatcher.


Application.Current.Dispatcher
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜