From d43147e6063d764d1222259adb533aa917f7c9a9 Mon Sep 17 00:00:00 2001 From: wanglei Date: Fri, 27 Nov 2026 15:40:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=8A=A8=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=AD=A5=E9=AA=A4=E5=90=8E=E5=8C=BA=E5=9F=9F=E5=80=99?= =?UTF-8?q?=E9=80=89=E6=9C=AA=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VVMs/RecipeEditor/EditorNodes.cs | 4 ++- tests/Avalonia.Smoke/Program.cs | 29 +++++++++++++++++-- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs b/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs index ed27a2a..bc8ac38 100644 --- a/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs +++ b/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs @@ -210,7 +210,7 @@ public class RecipeNode : EditorNode /// 违规类型下拉候选 public IReadOnlyList ViolationTypes { get; } - /// 区域名下拉候选(含空项,表示该字段不引用区域) + /// 区域名下拉候选快照(含空项,表示该字段不引用区域)。区域键或集合变化后需通知下拉框重新读取。 public IReadOnlyList RegionNames { get @@ -237,6 +237,7 @@ public class RecipeNode : EditorNode node.Renamed += OnRegionRenamed; Regions.Add(node); + RaisePropertyChanged(nameof(RegionNames)); SelectedRegion = node; return node; @@ -254,6 +255,7 @@ public class RecipeNode : EditorNode foreach (var step in Steps.Where(s => s.Detection is not null && References(s.Detection, node.Key))) ClearRegionReferences(step.Detection!, node.Key); + RaisePropertyChanged(nameof(RegionNames)); SelectedRegion = Regions.FirstOrDefault(); } diff --git a/tests/Avalonia.Smoke/Program.cs b/tests/Avalonia.Smoke/Program.cs index b1916c6..d2f35c6 100644 --- a/tests/Avalonia.Smoke/Program.cs +++ b/tests/Avalonia.Smoke/Program.cs @@ -1404,7 +1404,7 @@ internal static class Smoke model.CancelAgentCommand.Execute(); for(var i=0;i<100&&model.IsAgentBusy;i++)await Task.Delay(10); Check(!model.IsAgentBusy&&model.Recipe.Steps.Count==originalCount,"Cancelling analysis never mutates the recipe"); - Check(editor.GetVisualDescendants().OfType