我知道Dispatcher.BeginInvoke()用于在UI线程中执行代码。最近,我注意到还有另一种使用'Deployment'类获取Dispatcher实例的方法。我想知道this.Dispatcher.BeginInvoke()和Deployment.Current.Dispatcher.BeginInvoke()函数之间是否有区别?什么时候应该使用this.Dispatcher.BeginInvoke()和Deployment.Current.Dispatcher.BeginInvoke()?
谢谢 Alex
Deployment.Current.Dispatcher
始终与UI线程相关联。Silverlight中没有Dispatcher.Current
。DependencyObject
的Dispatcher
属性也总是返回与UI线程相关联的Dispatcher
。因此,我正在尝试想象存在差异的情况。 - AnthonyWJones