diff --git a/dev/PowerNotifications/PowerNotifications.h b/dev/PowerNotifications/PowerNotifications.h index c734364993..077e7baa11 100644 --- a/dev/PowerNotifications/PowerNotifications.h +++ b/dev/PowerNotifications/PowerNotifications.h @@ -548,6 +548,12 @@ namespace winrt::Microsoft::Windows::System::Power co_return res; } + Power::EffectivePowerMode EffectivePowerMode2() + { + UpdateValuesIfNecessary(effectivePowerModeFunc); + return static_cast(m_cachedPowerMode); + } + event_token EffectivePowerModeChanged(const PowerEventHandler& handler) { return AddCallback(effectivePowerModeFunc, handler); @@ -686,6 +692,11 @@ namespace winrt::Microsoft::Windows::System::Power return Factory()->EffectivePowerMode(); } + static Power::EffectivePowerMode EffectivePowerMode2() + { + return Factory()->EffectivePowerMode2(); + } + static Power::UserPresenceStatus UserPresenceStatus() { return Factory()->UserPresenceStatus(); diff --git a/dev/PowerNotifications/PowerNotifications.idl b/dev/PowerNotifications/PowerNotifications.idl index 922218f3ea..b6cded82ec 100644 --- a/dev/PowerNotifications/PowerNotifications.idl +++ b/dev/PowerNotifications/PowerNotifications.idl @@ -96,6 +96,7 @@ namespace Microsoft.Windows.System.Power static event Windows.Foundation.EventHandler SystemIdleStatusChanged; static Windows.Foundation.IAsyncOperation EffectivePowerMode{ get; }; + static EffectivePowerMode EffectivePowerMode2{ get; }; static event Windows.Foundation.EventHandler EffectivePowerModeChanged; static UserPresenceStatus UserPresenceStatus{ get; };