Improve error handling, debouncing, and code cleanup

Enhanced exception handling in RelayCommand to improve robustness.
Standardized slider debounce delays using a new constant
`SliderDebounceDelayMs`. Improved resource management in
SimpleDebouncer with proper disposal of CancellationTokenSource
and added support for synchronous actions. Refactored event
handling in App.xaml.cs for clarity and consistency. Removed
redundant logging in MonitorStateManager and MainViewModel to
reduce verbosity. Updated namespaces and dependencies for better
organization. General code cleanup to improve readability and
maintainability.
This commit is contained in:
Yu Leng
2025-11-19 15:26:35 +08:00
parent ad83b5e67f
commit a48e999963
9 changed files with 137 additions and 59 deletions

View File

@@ -73,8 +73,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{
Logger.LogInfo("Received refresh monitors event from PowerDisplay.exe");
ReloadMonitorsFromSettings();
},
_cancellationTokenSource.Token);
});
}
private void InitializeEnabledValue()