Accelerometer, like the other sensor types, uses an event-based model for monitoring changes to sensor readings.
Accelerometer contains a
ReadingChanged event, which should not be used because it is a remnant of the first release of the Windows Phone OS and has been deprecated as of the 7.1 release of the SDK.
The event to use is the base class
CurrentValueChanged. Subscribing to the event can be done as follows:
var accelerometer = new Accelerometer();accelerometer.CurrentValueChanged += HandleSensorValueChanged;accelerometer.Start();
CurrentValueChanged event is raised, the event handler receives a
> object, ...