public void OnSensorChanged(SensorEvent e)
        {
            if (SensorValueChanged == null)
                return;

            DeviceSensorValues sensorValues = new DeviceSensorValues();
            sensorValues.Values[0] = e.Values[0];
            sensorValues.Values[1] = e.Values[1];
            sensorValues.Values[2] = e.Values[2];
            //float[] temp = new float[3];
            //SensorManager.RemapCoordinateSystem(sensorValues.Values, Axis.X, Axis.Z, temp);
            //sensorValues.Values = temp;
            switch (e.Sensor.Type)
            {
                case SensorType.Accelerometer:
                    SensorValueChanged(this, new SensorValueChangedEventArgs(sensorValues, DeviceSensorType.Accelerometer));
                    break;
                case SensorType.Gravity:
                    SensorValueChanged(this, new SensorValueChangedEventArgs(sensorValues, DeviceSensorType.Gravimeter));
                    break;
                case SensorType.Gyroscope:
                    SensorValueChanged(this, new SensorValueChangedEventArgs(sensorValues, DeviceSensorType.Gyroscope));
                    break;
                case SensorType.MagneticField:
                    SensorValueChanged(this, new SensorValueChangedEventArgs(sensorValues, DeviceSensorType.Magnetometer));
                    break;
                case SensorType.Orientation:
                    SensorValueChanged(this, new SensorValueChangedEventArgs(sensorValues, DeviceSensorType.Orientation));
                    break;
            }
        }
 public SensorValueChangedEventArgs(DeviceSensorValues sv, DeviceSensorType st)
 {
     SensorValues = sv;
     SensorType = st;
 }