Share via


PowerManager.BatteryStatusChanged Event

Definition

Raised when the status of the battery on the device has changed.

// Register
static event_token BatteryStatusChanged(EventHandler<IInspectable> const& handler) const;

// Revoke with event_token
static void BatteryStatusChanged(event_token const* cookie) const;

// Revoke with event_revoker
static PowerManager::BatteryStatusChanged_revoker BatteryStatusChanged(auto_revoke_t, EventHandler<IInspectable> const& handler) const;
public static event System.EventHandler<object> BatteryStatusChanged;
function onBatteryStatusChanged(eventArgs) { /* Your code */ }
Microsoft.Windows.System.Power.PowerManager.addEventListener("batterystatuschanged", onBatteryStatusChanged);
Microsoft.Windows.System.Power.PowerManager.removeEventListener("batterystatuschanged", onBatteryStatusChanged);
- or -
Microsoft.Windows.System.Power.PowerManager.onbatterystatuschanged = onBatteryStatusChanged;
Public Shared Custom Event BatteryStatusChanged As EventHandler(Of Object) 

Event Type

Remarks

To get the current status of the battery in response to this event, use the BatteryStatus property.

Applies to

See also