PowerManager.BatteryStatusChanged Event
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.
Occurs when BatteryStatus changes.
// 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 */ }
Windows.System.Power.PowerManager.addEventListener("batterystatuschanged", onBatteryStatusChanged);
Windows.System.Power.PowerManager.removeEventListener("batterystatuschanged", onBatteryStatusChanged);
- or -
Windows.System.Power.PowerManager.onbatterystatuschanged = onBatteryStatusChanged;
Public Shared Custom Event BatteryStatusChanged As EventHandler(Of Object)