优化代码

This commit is contained in:
2025-09-30 17:46:35 +08:00
parent 92e695ef7c
commit 92bb458345
16 changed files with 71 additions and 131 deletions
@@ -53,8 +53,7 @@ namespace Ink_Canvas
foreach (var kvp in Settings.Automation.FloatingWindowInterceptor.InterceptRules)
{
var toggleName = $"ToggleSwitch{kvp.Key}";
var toggle = FindName(toggleName) as ToggleSwitch;
if (toggle != null)
if (FindName(toggleName) is ToggleSwitch toggle)
{
toggle.IsOn = kvp.Value;
}