Share via


Pedometer 类

定义

为计步器提供一个接口,用于测量执行的步骤数。

有关实现的示例,请参阅步程计示例

public ref class Pedometer sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class Pedometer final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class Pedometer
Public NotInheritable Class Pedometer
继承
Object Platform::Object IInspectable Pedometer
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

注意

JavaScript 不支持此类

版本历史记录

Windows 版本 SDK 版本 已添加值
1511 10586 GetCurrentReadings
1511 10586 GetReadingsFromTriggerDetails

属性

DeviceId

获取设备标识符。

MinimumReportInterval

此计步器支持的最小报告间隔。

PowerInMilliwatts

获取传感器消耗的功率。

ReportInterval

获取或设置计步器当前报告间隔。

方法

FromIdAsync(String)

从计步器标识符获取计步器。

GetCurrentReadings()

从计步器传感器获取当前步骤信息。

GetDefaultAsync()

异步获取默认计步器。

GetDeviceSelector()

获取设备选择器。

GetReadingsFromTriggerDetails(SensorDataThresholdTriggerDetails)

从后台任务中的触发器详细信息获取读数。

GetSystemHistoryAsync(DateTime)

异步获取特定时间的传感器读数。

GetSystemHistoryAsync(DateTime, TimeSpan)

异步获取来自特定时间和持续时间的计步器读数。

事件

ReadingChanged

每次计步器报告新值时发生。

适用于

另请参阅