现在的位置: 首页 > 综合 > 正文

wp 中的dispatcher

2014年02月12日 ⁄ 综合 ⁄ 共 373字 ⁄ 字号 评论关闭

this.Dispatcher.BeginInvoke() ensures
it is run on the thread that the control in question is running under.

Deployment.Current.Dispatcher.BeginInvoke() ensures
it is run on the main UI thread.

The two are always the same in Silverlight (and usually the same in WPF, unless you have created extra UI threads).

Use this.Dispatcher.BeginInvoke() unless
your current context does not have a dispatcher, then use the global one instead.

抱歉!评论已关闭.