Battery Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Methods and properties for battery and charging information of the device.
public static class Battery
- Inheritance
-
System.ObjectBattery
Remarks
Platform specific remarks:
- Android: Battery_Stats permission must be set in manifest.
- iOS: Simulator will not return battery information, must be run on device
- UWP: None
Properties
ChargeLevel |
Gets the current charge level of the device from 0.0 to 1.0. |
EnergySaverStatus |
Gets the current energy saver status of the device. |
PowerSource |
Gets the current power source for the device. |
State |
Gets the charging state of the device if it can be determined. |
Events
BatteryInfoChanged |
Event trigger when battery properties have changed. |
EnergySaverStatusChanged |
Event that is triggered when energy saver status changes. |