简体   繁体   English

从BackGround任务读取数据(Windows Phone)

[英]Reading Data From a BackGround Task (Windows Phone)

I need to know how I should represent accelerometer data retrieved by a background task in the UI. 我需要知道如何表示由UI中的后台任务检索到的加速度计数据。 Is data binding an option? 数据绑定是一种选择吗? Can I do it the same way that I would with the code-behind pages of the UI? 是否可以使用与UI的代码隐藏页面相同的方式进行操作? Can I access a variable from the background task page from another C# page (mainpage.xaml.cs for example)? 我可以从另一个C#页面(例如mainpage.xaml.cs)的后台任务页面访问变量吗?

Also I need to know the way the accelerometer data is captured and provided to the developer. 我还需要了解加速度计数据的捕获方式并将其提供给开发人员。 For example is it in terms of Gs or is just raw values and If it is a raw value, how would I convert that to a value in terms of Gs. 例如,它是Gs还是原始值,如果是原始值,我将如何将其转换为Gs值。

I'm developing for Windows Phone 8.1 using C#. 我正在使用C#开发Windows Phone 8.1。

Any help would be appreciated. 任何帮助,将不胜感激。

Thank You 谢谢

Take a look at this sample code from MSDN which runs audio files in a Background task. 看一下来自MSDN的此示例代码,该示例代码在后台任务中运行音频文件。 http://code.msdn.microsoft.com/windowsapps/BackgroundAudio-63bbc319 http://code.msdn.microsoft.com/windowsapps/BackgroundAudio-63bbc319

This will give you a clear idea on how to pass data from foreground task to background task and vice versa. 这将使您对如何将数据从前台任务传递到后台任务(反之亦然)传递一个清晰的思路。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM