PowerManager Class

Definition

Provides static events that notify your app of changes to the devices power state and static properties that provide access to current power state information.

public ref class PowerManager abstract sealed
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Version(1)]
class PowerManager final
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.System.Power.PowerNotificationsContract, 65536)]
class PowerManager final
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Version(1)]
public static class PowerManager
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.System.Power.PowerNotificationsContract), 65536)]
public static class PowerManager
Public Class PowerManager
Inheritance
Object Platform::Object IInspectable PowerManager
Attributes

Examples

For code examples that demonstrsate how to use this class, see Power management with the app lifecycle API.

Remarks

For more information about using this class, see Power management with the app lifecycle API.

Properties

BatteryStatus

Gets the current status of the battery on the device.

DisplayStatus

Gets the current status of the display that is associated with the app's session.

EffectivePowerMode

Gets the current effective power mode of the device.

EffectivePowerMode2

Gets the current effective power mode of the device.

EnergySaverStatus

Gets the current state of battery saver on the device.

PowerSourceKind

Gets the current power source of the device.

PowerSupplyStatus

Gets the current power supply status of the device.

RemainingChargePercent

Gets the remaining charge percentage of the battery on the device.

RemainingDischargeTime

Gets the remaining discharge time of the battery on the device.

SystemSuspendStatus

Gets the current suspend status of the device.

UserPresenceStatus

Gets the current user status associated with the app's session.

Events

BatteryStatusChanged

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

DisplayStatusChanged

Raised when the status of the display that is associated with the app's session has changed.

EffectivePowerModeChanged

Raised when the effective power mode of the device has changed.

EnergySaverStatusChanged

Raised when battery saver has been turned off or on in response to changing power conditions.

PowerSourceKindChanged

Raised when the power source of the device has changed.

PowerSupplyStatusChanged

Raised when the power supply status of the device has changed.

RemainingChargePercentChanged

Raised when the remaining charge percentage of the battery on the device has changed.

RemainingDischargeTimeChanged

Raised when the remaining discharge time of the battery on the device has changed.

SystemIdleStatusChanged

Raised when the system is busy. This indicates that the system will not be moving into an idle state in the near future and that the current time is a good time for components to perform background or idle tasks that would otherwise prevent the computer from entering an idle state.

SystemSuspendStatusChanged

Raised when the suspend status of the device has changed.

UserPresenceStatusChanged

Raised when the user status associated with the app's session has changed.

Applies to

See also