From 6359fadad8e866d376567930f5fce3b3464eae3c Mon Sep 17 00:00:00 2001 From: tfarcraw <123211521@163.com> Date: Sun, 8 Nov 2026 21:51:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=BB=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=9C=A8=E5=BC=80=E5=A7=8B=E5=89=8D=E6=98=BE=E7=A4=BA=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E6=89=80=E9=80=89=E9=85=8D=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SopHelper.Avalonia/VVMs/SopPage/SopPage.axaml | 2 +- tests/Avalonia.Smoke/Program.cs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/SopHelper.Avalonia/VVMs/SopPage/SopPage.axaml b/src/SopHelper.Avalonia/VVMs/SopPage/SopPage.axaml index cff3937..b7685ff 100644 --- a/src/SopHelper.Avalonia/VVMs/SopPage/SopPage.axaml +++ b/src/SopHelper.Avalonia/VVMs/SopPage/SopPage.axaml @@ -59,7 +59,7 @@ - + diff --git a/tests/Avalonia.Smoke/Program.cs b/tests/Avalonia.Smoke/Program.cs index 3bf61d9..c376f09 100644 --- a/tests/Avalonia.Smoke/Program.cs +++ b/tests/Avalonia.Smoke/Program.cs @@ -65,6 +65,7 @@ internal static class Smoke var sopView=window.GetVisualDescendants().OfType().Single(); Check(!sopView.GetVisualDescendants().Any(c=>c is ComboBox or Slider),"Operator page contains no camera, recipe or parameter editors"); Check(sop.ActiveRecipe=="未应用配方","No recipe is reported active before applying"); + Check(!string.IsNullOrWhiteSpace(sop.SelectedRecipe)&&sopView.GetVisualDescendants().OfType().Any(t=>t.Text==sop.SelectedRecipe),"Operator page displays the selected recipe before applying or starting"); navigation.SelectedIndex=2;await Task.Delay(100); var settings=window.GetVisualDescendants().OfType().Single(); Check(ReferenceEquals(settings.DataContext,sop),"Settings and operator page share runtime state"); @@ -74,7 +75,11 @@ internal static class Smoke var applied=sop.ActiveRecipe;var selected=sop.SelectedRecipe; sop.SelectedRecipe="pending.yaml"; Check(sop.ActiveRecipe==applied,"Unapplied recipe selection does not change current recipe"); - sop.SelectedRecipe=selected; + navigation.SelectedIndex=0;await Task.Delay(80); + Check(window.GetVisualDescendants().OfType().Single().GetVisualDescendants().OfType().Any(t=>t.Text=="pending.yaml"),"Operator page updates to the selected recipe without applying or starting"); + sop.SelectedRecipe=selected;await Task.Delay(80); + Check(window.GetVisualDescendants().OfType().Single().GetVisualDescendants().OfType().Any(t=>t.Text==selected),"Recipe selection changes notify the operator page immediately"); + navigation.SelectedIndex=2;await Task.Delay(80); Save(window,"runtime-settings"); navigation.SelectedIndex=0;await Task.Delay(100); Check(window.GetVisualDescendants().OfType().Single().GetVisualDescendants().OfType().Any(t=>t.Text==applied),"Operator page displays the applied recipe");