![](/img/trans.png)
[英]How can I find out whether method executes on UI thread or not in a decoupled way?
[英]In Silverlight, how do you find out whether the code is running in the UI thread or not?
基本上我需要知道我是否需要Dispatcher.BeginInvoke或者是否需要它。
謝謝。
您可以使用Dispatcher.CheckAccess
方法。 如果您與UI調度程序位於同一個線程,則返回true,否則返回false
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.