Update dispatcher usage and handle power state changes

Switched to dispatcher.TryEnqueue for UI flag reset in DashboardViewModel. Added handling for MonitorInfo.EnablePowerState changes in PowerDisplayViewModel to trigger settings updates.
This commit is contained in:
Yu Leng
2026-01-22 11:56:30 +08:00
parent ddd2490049
commit 42303cc17b
2 changed files with 2 additions and 1 deletions

View File

@@ -258,7 +258,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
finally
{
// Use dispatcher to reset flag after UI updates complete
dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, () =>
dispatcher.TryEnqueue(DispatcherQueuePriority.Low, () =>
{
_isSorting = false;
});

View File

@@ -336,6 +336,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
e.PropertyName == nameof(MonitorInfo.EnableInputSource) ||
e.PropertyName == nameof(MonitorInfo.EnableRotation) ||
e.PropertyName == nameof(MonitorInfo.EnableColorTemperature) ||
e.PropertyName == nameof(MonitorInfo.EnablePowerState) ||
e.PropertyName == nameof(MonitorInfo.IsHidden))
{
SignalSettingsUpdated();