CurrentValue Property
Collapse the table of content
Expand the table of content

SensorBase<TSensorReading>.CurrentValue Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets an object that implements ISensorReading that contains the current value of the sensor. This object will be one of the following types, depending on which sensor is being referenced: AccelerometerReading, CompassReading, GyroscopeReading, MotionReading.

Namespace:  Microsoft.Devices.Sensors
Assembly:  Microsoft.Devices.Sensors (in Microsoft.Devices.Sensors.dll)

public TSensorReading CurrentValue { get; }

Property Value

Type: TSensorReading
An object that implements ISensorReading that contains the current value of the sensor.

If the sensor is not present, a System.InvalidOperationException is thrown when you access this property. Before accessing this property, use the IsSupported property for the particular sensor to determine if the device is present and handle the InvalidOpertionException gracefully in case that sensor does not exist.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2017 Microsoft