void OnReadingChanged(Sensor sender, LightSensorReadingChangedEventArgs args) { var handler = changed; if (handler != null) { var value = args.Reading.IlluminanceInLux; var e = new AmbientLightEventArgs(value); handler.Invoke(this, e); } }