在WPF中,示例代码如下:
this.Dispatcher.BeginInvoke(newAction(() =>{
if (sensor == (char)1)
{
xxx.Text = x.ToString();
yyy.Text = y.ToString();
zzz.Text = z.ToString();
}
}));
在Metro中,示例代码如下:
Dispatcher.InvokeAsync(CoreDispatcherPriority.Normal, (object obj, InvokedHandlerArgs args) =>
{
OutputText.Text = mb.channel_str;
//System.Diagnostics.Debug.WriteLine("Test Replace!!!!!!!!!!!!!!!");
}, OutputText.Text,null);
推荐一个资源,不错:
http://www.cnblogs.com/mgen/archive/2012/03/10/2389509.html