Compass​Reading Compass​Reading Compass​Reading Class

Definition

Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Prerelease APIs are identified by a Prerelease label.

Prerelease. Represents a compass reading.

public : sealed class CompassReading : ICompassReading, ICompassReadingHeadingAccuracypublic sealed class CompassReading : ICompassReading, ICompassReadingHeadingAccuracyPublic NotInheritable Class CompassReading Implements ICompassReading, ICompassReadingHeadingAccuracy
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This object is accessed when you invoke the GetCurrentReading method; and, it is accessed when you retrieve the Reading property of the CompassReadingChangedEventArgs object in the event callback method.

Properties

HeadingAccuracy HeadingAccuracy HeadingAccuracy

Gets the compass's heading accuracy.

public : MagnetometerAccuracy HeadingAccuracy { get; }public MagnetometerAccuracy HeadingAccuracy { get; }Public ReadOnly Property HeadingAccuracy As MagnetometerAccuracy
Value
MagnetometerAccuracy MagnetometerAccuracy MagnetometerAccuracy

The compass's heading accuracy.

Attributes

HeadingMagneticNorth HeadingMagneticNorth HeadingMagneticNorth

Gets the heading in degrees relative to magnetic-north.

public : double HeadingMagneticNorth { get; }public double HeadingMagneticNorth { get; }Public ReadOnly Property HeadingMagneticNorth As double
Value
double double double

The magnetic-north heading.

Attributes

HeadingTrueNorth HeadingTrueNorth HeadingTrueNorth

Gets the heading in degrees relative to geographic true-north.

public : IReference<double> HeadingTrueNorth { get; }public Nullable<double> HeadingTrueNorth { get; }Public ReadOnly Property HeadingTrueNorth As Nullable<double>
Value
IReference<double> Nullable<double> Nullable<double>

The true-north heading.

Attributes

Remarks

Before retrieving this property, your code should first check to verify that the value is not null. (If the value is null and you attempt to retrieve it, Windows will generate an exception.)

In order to retrieve the declination, your app needs to have access to the device's current location. If the location is not available, the declination defaults to 0 degrees. In this scenario, HeadingTrueNorth equals HeadingMagneticNorth.

PerformanceCount PerformanceCount PerformanceCount

Prerelease. Gets the performance count associated with the reading. This allows the reading to be synchronized with other devices and processes on the system.

public : IReference<TimeSpan> PerformanceCount { get; }public Nullable<TimeSpan> PerformanceCount { get; }Public ReadOnly Property PerformanceCount As Nullable<TimeSpan>
Value
IReference<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan>

The performance count for the reading. Null if this property is not supported on the sensor.

Attributes
Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16225.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Properties Properties Properties

Prerelease. Gets the data properties reported by the sensor.

public : IMapView<string, object> Properties { get; }public IReadOnlyDictionary<string, object> Properties { get; }Public ReadOnly Property Properties As IReadOnlyDictionary<string, object>
Value
IMapView<PlatForm::String, PlatForm::Object> IReadOnlyDictionary<string, object> IReadOnlyDictionary<string, object>

Contains a key/value pair for each data property reported by the sensor for the given reading. The key is a string of the property key, and the value is the value of the property that the key represents.

Attributes
Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16225.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Timestamp Timestamp Timestamp

Gets the time at which the sensor reported the reading.

public : DateTime Timestamp { get; }public DateTimeOffset Timestamp { get; }Public ReadOnly Property Timestamp As DateTimeOffset
Value
DateTime DateTimeOffset DateTimeOffset

The time at which the sensor reported the reading.

Attributes

See Also