-api-id | -api-type |
---|---|
E:Windows.Devices.Sensors.Accelerometer.ReadingChanged |
winrt event |
Occurs each time the accelerometer reports a new sensor reading.
An application may register this event handler to obtain sensor readings. The application must establish a desired ReportInterval. This informs the sensor driver that resources should be allocated to satisfy the requirements of the application.
The following example demonstrates how a UWP app built with C# and XAML registers its ReadingChanged event handler.
[!code-csharpEnableReadingChangedCS]
The following example shows the ReadingChanged event handler.
[!code-csharpReadingChangedCS]