如何让调度员在非UI代码的Windows Phone 8 [英] How to get Dispatcher in non UI code windows phone 8

查看:123
本文介绍了如何让调度员在非UI代码的Windows Phone 8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在Windows CoreDispatcher 对象8为



  CoreDispatcher调度= Windows.UI.Core.CoreWindow.GetForCurrentThread()调度。 



但我怎么能获得调度中的Windows Phone 8结果
这样我可以调用

  Dispatcher.BeginInvoke(代表
$ { b $ b //我的报表
});


解决方案

使用 Deployment.Current。调度员来获得在Windows Phone上的调度对象。


I can get the CoreDispatcher object in windows 8 as

CoreDispatcher dispatcher = Windows.UI.Core.CoreWindow.GetForCurrentThread().Dispatcher;

But how can I get the Dispatcher in windows phone 8
So that I can call

Dispatcher.BeginInvoke(delegate
{
    //My statements
});

解决方案

Use Deployment.Current.Dispatcher to get the Dispatcher object in Windows Phone.

这篇关于如何让调度员在非UI代码的Windows Phone 8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆