Eri*_*ric 5 .net silverlight multithreading
在WinForms UserControl中,我会通过从任何控件的方法调用this.BeginInvoke()将数据传递给主GUI线程.什么是Silverlight UserControl中的等价物?
换句话说,我如何获取任意工作线程提供的数据并确保它在主显示线程上得到处理?
使用UserControl类上的Dispatcher属性.
private void UpdateStatus()
{
this.Dispatcher.BeginInvoke( delegate { StatusLabel.Text = "Updated"; });
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3593 次 |
| 最近记录: |