PowerManager PowerManager PowerManager PowerManager PowerManager Class

Definition

Provides information about whether the phone's battery is in power-saving mode.

public : static class PowerManager
static struct winrt::Windows::Phone::System::Power::PowerManager
public static class PowerManager
Public Static Class PowerManager
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)

Properties

PowerSavingMode PowerSavingMode PowerSavingMode PowerSavingMode PowerSavingMode

Gets a value that indicates whether the phone's battery is in power-saving mode.

public : static PowerSavingMode PowerSavingMode { get; }
static PowerSavingMode PowerSavingMode();
public static PowerSavingMode PowerSavingMode { get; }
Public Static ReadOnly Property PowerSavingMode As PowerSavingMode
var powerSavingMode = Windows.Phone.System.Power.PowerManager.powerSavingMode;
Value
PowerSavingMode PowerSavingMode PowerSavingMode

true if the phone's battery is in power-saving mode; otherwise, false.

PowerSavingModeEnabled PowerSavingModeEnabled PowerSavingModeEnabled PowerSavingModeEnabled PowerSavingModeEnabled

Gets a value indicating whether power saving mode is currently enabled on the phone, regardless of whether power saving mode is currently active.

public : static Platform::Boolean PowerSavingModeEnabled { get; }
static bool PowerSavingModeEnabled();
public static bool PowerSavingModeEnabled { get; }
Public Static ReadOnly Property PowerSavingModeEnabled As bool
var bool = Windows.Phone.System.Power.PowerManager.powerSavingModeEnabled;
Value
bool bool bool

A value indicating whether power saving mode is currently enabled on the phone, regardless of whether power saving mode is currently active.

Events

PowerSavingModeChanged PowerSavingModeChanged PowerSavingModeChanged PowerSavingModeChanged PowerSavingModeChanged

Occurs when the power-saving mode of the phone's battery is changed.

public : event EventHandler PowerSavingModeChanged<Platform::Object>
// Register
event_token PowerSavingModeChanged(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token
void PowerSavingModeChanged(event_token const& cookie) const;

// Revoke with event_revoker
PowerSavingModeChanged_revoker PowerSavingModeChanged(auto_revoker_t, EventHandler<Platform::Object> const& handler) const;
public event EventHandler PowerSavingModeChanged<object>
Public Event EventHandler PowerSavingModeChanged( Of ( Of object ))
function onPowerSavingModeChanged(eventArgs){/* Your code */}


powerManager.addEventListener("powerSavingModeChanged", onPowerSavingModeChanged);
powerManager.removeEventListener("powerSavingModeChanged", onPowerSavingModeChanged);