PowerManager.PowerSourceKindChanged 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.
Raised when the power source of the device has changed.
// Register
static event_token PowerSourceKindChanged(EventHandler<IInspectable> const& handler) const;
// Revoke with event_token
static void PowerSourceKindChanged(event_token const* cookie) const;
// Revoke with event_revoker
static PowerManager::PowerSourceKindChanged_revoker PowerSourceKindChanged(auto_revoke_t, EventHandler<IInspectable> const& handler) const;
public static event System.EventHandler<object> PowerSourceKindChanged;
function onPowerSourceKindChanged(eventArgs) { /* Your code */ }
Microsoft.Windows.System.Power.PowerManager.addEventListener("powersourcekindchanged", onPowerSourceKindChanged);
Microsoft.Windows.System.Power.PowerManager.removeEventListener("powersourcekindchanged", onPowerSourceKindChanged);
- or -
Microsoft.Windows.System.Power.PowerManager.onpowersourcekindchanged = onPowerSourceKindChanged;
Public Shared Custom Event PowerSourceKindChanged As EventHandler(Of Object)
Event Type
Remarks
To get the current power source of the device in response to this event, use the PowerSourceKind property. This event corresponds to the GUID_ACDC_POWER_SOURCE power setting GUID.