Accelerometer.ReadingTransform Property


Gets or sets the transformation that needs to be applied to sensor data. Transformations to be applied are tied to the display orientation with which to align the sensor data.

 property DisplayOrientations ReadingTransform { DisplayOrientations get(); void set(DisplayOrientations value); };
DisplayOrientations ReadingTransform();

void ReadingTransform(DisplayOrientations value);
public DisplayOrientations ReadingTransform { get; set; }
var displayOrientations = accelerometer.readingTransform;
accelerometer.readingTransform = displayOrientations;
Public Property ReadingTransform As DisplayOrientations

Property Value


A DisplayOrientations-typed value that specifies the display orientation with which to align the sensor data.


This property provides these improvements:

  • Differences in the sensor data on landscape-first devices versus portrait-first devices are no longer important.
  • Easily port existing sensor-based apps that were written for landscape-first devices to portrait-first devices and vice-versa.
  • Allows handling of display orientation changes. You can align the sensor data with the current orientation by updating the sensor’s ReadingTransform to match the current display orientation.
  • Allows aligning sensor data with a display orientation that is different from the current display orientation.

Applies to