开发者

In Silverlight, how do you find out whether the code is running in the UI thread or not?

开发者 https://www.devze.com 2022-12-16 13:46 出处:网络
Basically 开发者_如何学CI need to know whether I need to can Dispatcher.BeginInvoke or if it\'s not needed.

Basically 开发者_如何学CI need to know whether I need to can Dispatcher.BeginInvoke or if it's not needed.

Thanks.


You can use the Dispatcher.CheckAccess method. It returns true if you're on the same thread as the UI dispatcher, and false otherwise

0

精彩评论

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