- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试从 Microsoft Band 获取心率。只要值发生变化,它就应该更新。然后我试图在 TextBlock
中显示该值。我首先创建了一个 IBandClient
实例,并像这样设置它的 HeartRate.ReadingChanged
方法:
bandClient.SensorManager.HeartRate.ReadingChanged += HeartRate_ReadingChanged;
然后我尝试像这样更新值:
private void HeartRate_ReadingChanged(object sender, Microsoft.Band.Sensors.BandSensorReadingEventArgs<Microsoft.Band.Sensors.IBandHeartRateReading> e)
{
HeartRate = e.SensorReading.HeartRate;
}
HeartRate 是一个 int
设置,如下所示:
public int HeartRate
{
get { return (int)GetValue(HeartRateProperty); }
set { SetValue(HeartRateProperty, value); }
}
// Using a DependencyProperty as the backing store for HeartRate. This enables animation, styling, binding, etc...
public static readonly DependencyProperty HeartRateProperty =
DependencyProperty.Register("HeartRate", typeof(int), typeof(MainPage), new PropertyMetadata(0));
TextBlock
文本然后绑定(bind)到 HeartRate
。但是,我在尝试设置 HeartRate
时不断收到此错误:
The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))
我的猜测是它正在尝试设置 HeartRate
,而之前的调用仍在设置它。
最佳答案
尝试实现它,看看效果如何,如果您仍然需要 int 变量,则在文本 block 中显示它时将其转换回字符串。
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
() =>
{
Textblock.Text = e.SensorReading.HeartRate.ToString())
}).AsTask();
关于c# - 从 Microsoft Band 获取心率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31215873/
我想创建一个类似于乐队附带的星巴克应用程序的应用程序。我想显示条形码。我可以在云端或本地设备上将条形码生成为 JPG 图像,但我需要能够在乐队的屏幕上显示它们。到目前为止,我还没有找到使用 Band
Microsoft Band SDK 文档中提到使用 WriteableBitmap 创建磁贴图标,但如何让它指向我为磁贴制作的现有图像? 最佳答案 如果您的 Windows Phone 应用程序有一
有没有一种好的方法可以在打开 band 磁贴时触发 Windows 应用商店后台任务?是否有使用最新 SDK 从后台任务处理乐队的示例?我看到有人提到了这样做的能力,但找不到这方面的任何代码示例。 我
我这里有个情况。几个星期以来,我一直在努力解决这个问题。我是 iReport 的新手。 这几天我在为一个公司部门设计一个报表。 我的报告只有 3 个部分,即 Title、Detail 和 Summar
我正在创建一个使用新的自定义页面布局的 Microsoft Band 应用。我使用的是 Microsoft Visual Studio Community 2013 update 4。我的一切工作正常
我需要在 Delphi 5 中创建一个 QuickReport,其布局如下: +================ | Report Header +================ +========
我需要将 QuickReport 导出为 XLS 文件,问题是我的数据对象之间有空列,发生这种情况是因为在创建流时,设置了列根据物体的位置从上到下,这样如果对象的左侧位置未设置为完全相同的位置作为留在
最近,我一直在尝试清理我的openGl渲染。我已经有一段时间了,但是从来没有真正考虑过。这是一个屏幕截图: 经过一些研究,我一直无法弄清楚它到底出了什么问题。我在OSX上使用OpenGl,但在其他系统
1> Band = band. * 1: syntax error before: 'band' 我试图在这里做一个原子,但是出现语法错误。为什么? 最佳答案 从编译器错误中还不清楚,但是您正在得到,
我购买了微软手环。我的范围是使用该设备来实时跟踪步数和心率等信息。我想知道有没有一种方法可以在没有第三个设备的情况下直接将这些数据实时传输到电脑,例如使用蓝牙设备?是否有文件系统可以在 Band 设备
我正在创建一个 Windows 8.1 Phone 应用程序。 UI 有一个按钮和一个文本框(称为 txtStatus) 基本上,当我单击 UI 中的按钮时,将启动以下代码(仅显示其中的一部分):
我正在尝试异步验证 Nymi band 。但是当我尝试这样做时,出现以下异常: java.lang.RuntimeException: Can't create handler inside thre
我正在为乐队开发 UWP。有什么方法可以在某些序列号/唯一 ID 或其他东西上识别连接的频段。就像我发现连接的乐队一样 IBandInfo[] pairedBands = await BandClie
我正在创建自定义磁贴。我希望该磁贴能够读取一些传感器数据,例如心率,然后与移动应用程序进行通信。我也想同步数据 MS Health Cloud API 感谢任何帮助/想法 [微软乐队] 最佳答案 要与
我想使用 multiband blending 混合两个图像但我不清楚这个函数的输入参数: void detail::Blender::prepare(const std::vector& corne
我正在开发一个面向通用 Windows 和 .Net 应用程序的可移植类库,我从 NuGet 安装了 Microsoft.Band SDK,这解决了大部分带符号: IBandInfo[] paired
我尝试从手环读取加速度计值,即使 手机已锁定 应用没有焦点 在应用获得焦点时读取值效果很好。但是,如果我按下“Windows”按钮并在其他应用程序上工作,则不会再触发任何 ChangedEventAr
尝试在 VS2015 中使用 MSTest 和 Microsoft Band nuGet 包进行单元测试并遇到以下错误 "Microsoft.Band.BandIOException: An erro
我使用 UDP 编写了多人游戏 Pong。我正在使用插值和外推来为客户端创建平滑的外观效果。 它有效。但是,球中有一些持续的口吃。每次收到新数据包时,它都会向前跳一点点。它看起来有点滞后,但可以玩。
在 Cordova CLI v3.4 中使用 ionicframework 我在 config.xml 文件中使用以下首选项。 通过 CLI 和 XCode 编译似乎没有解决任何问题。 然后我搜
我是一名优秀的程序员,十分优秀!