MagnetometerReading MagnetometerReading MagnetometerReading MagnetometerReading Class

Represents a magnetometer reading.

Syntax

Declaration

public sealed class MagnetometerReadingpublic sealed class MagnetometerReadingPublic NotInheritable Class MagnetometerReadingpublic sealed class MagnetometerReading

Remarks

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

Properties summary

Gets the magnetometer's directional accuracy.

Gets the magnetic field strength in microteslas along the X axis.

Gets the magnetic field strength in microteslas along the Y axis.

Gets the magnetic field strength in microteslas along the Z axis.

Gets the time at which the sensor reported the reading.

Properties

  • DirectionalAccuracy
    DirectionalAccuracy
    DirectionalAccuracy
    DirectionalAccuracy

    Gets the magnetometer's directional accuracy.

    public MagnetometerAccuracy DirectionalAccuracy { get; }public MagnetometerAccuracy DirectionalAccuracy { get; }Public ReadOnly Property DirectionalAccuracy As MagnetometerAccuracypublic MagnetometerAccuracy DirectionalAccuracy { get; }

    Property Value

  • MagneticFieldX
    MagneticFieldX
    MagneticFieldX
    MagneticFieldX

    Gets the magnetic field strength in microteslas along the X axis.

    public float MagneticFieldX { get; }public float MagneticFieldX { get; }Public ReadOnly Property MagneticFieldX As floatpublic float MagneticFieldX { get; }

    Property Value

    • float
      float
      float
      float

      The magnetic field strength in microteslas along the X axis.

    Remarks

    The accuracy of this value depends on the state of magnetometer calibration reflected in the DirectionalAccuracy property.

  • MagneticFieldY
    MagneticFieldY
    MagneticFieldY
    MagneticFieldY

    Gets the magnetic field strength in microteslas along the Y axis.

    public float MagneticFieldY { get; }public float MagneticFieldY { get; }Public ReadOnly Property MagneticFieldY As floatpublic float MagneticFieldY { get; }

    Property Value

    • float
      float
      float
      float

      The magnetic field strength in microteslas along the Y axis.

    Remarks

    The accuracy of this value depends on the state of magnetometer calibration reflected in the DirectionalAccuracy property.

  • MagneticFieldZ
    MagneticFieldZ
    MagneticFieldZ
    MagneticFieldZ

    Gets the magnetic field strength in microteslas along the Z axis.

    public float MagneticFieldZ { get; }public float MagneticFieldZ { get; }Public ReadOnly Property MagneticFieldZ As floatpublic float MagneticFieldZ { get; }

    Property Value

    • float
      float
      float
      float

      The magnetic field strength in microteslas along the Z axis.

    Remarks

    The accuracy of this value depends on the state of magnetometer calibration reflected in the DirectionalAccuracy property.

  • Timestamp
    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 DateTimeOffsetpublic DateTime Timestamp { get; }

    Property Value

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute

Details

Assembly

Windows.Devices.Sensors.dll