From 99ac3f2b8dc777e21fef17eae3f52754f1c867ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Chsc=E2=80=9D?= <“huangsucan@kaiyili-lab.com”>
Date: Fri, 7 Aug 2026 14:43:57 +0800
Subject: [PATCH] =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A8=8B=E5=BA=8F=E5=AD=90?=
=?UTF-8?q?=E7=A8=8B=E5=BA=8F=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ACP/ViewModels/ShellViewModel.cs | 17 ++-
ACP/Views/ShellView.xaml | 10 +-
.../ViewModels/CommandTreeViewModel.cs | 32 +++-
.../ViewModels/StepsManagerViewModel.cs | 142 +++++++++---------
TestingModule/Views/StepsManager.xaml | 40 +++--
.../GlobalVariable/ProgramNavigationState.cs | 89 +++++++++++
UIShare/GlobalVariable/ScopedContext.cs | 64 ++------
UIShare/GlobalVariable/StepRunning.cs | 13 +-
UIShare/PubEvent/SubProgramNavigateEvent.cs | 3 +
9 files changed, 261 insertions(+), 149 deletions(-)
create mode 100644 UIShare/GlobalVariable/ProgramNavigationState.cs
diff --git a/ACP/ViewModels/ShellViewModel.cs b/ACP/ViewModels/ShellViewModel.cs
index af76648..a49621e 100644
--- a/ACP/ViewModels/ShellViewModel.cs
+++ b/ACP/ViewModels/ShellViewModel.cs
@@ -46,11 +46,18 @@ namespace ACP.ViewModels
#region 子程序导航
- ///
- /// 当前台架是否可以返回上一级
- ///
- public bool CanGoBack => CurrentContext?.CanGoBack ?? false;
+ public bool CanGoBack =>
+ (CurrentContext?.MainNav.CanGoBack ?? false) ||
+ (CurrentContext?.ErrorNav.CanGoBack ?? false);
+ private void OnGoBack()
+ {
+ var ctx = CurrentContext;
+ if (ctx == null) return;
+ // 工具栏按钮同时重置两个 Tab 的导航
+ ctx.MainNav.Reset(ctx.Program, "主程序");
+ ctx.ErrorNav.Reset(ctx.Program, "错误程序");
+ }
#endregion
@@ -167,6 +174,7 @@ namespace ACP.ViewModels
public ICommand GetFileStringCommand { get; set; }
public ICommand SilenceBuzzerCommand { get; set; }
public ICommand SettingChannelCommand { get; set; }
+ public ICommand GoBackCommand { get; set; }
#endregion
public ShellViewModel(IContainerProvider containerProvider)
@@ -218,6 +226,7 @@ namespace ACP.ViewModels
SilenceBuzzerCommand = new AsyncDelegateCommand(SilenceBuzzer);
SettingChannelCommand = new AsyncDelegateCommand(SilenceBuzzer);
SettingChannelCommand = new DelegateCommand(SettingChannel);
+ GoBackCommand = new DelegateCommand(OnGoBack);
_globalInfo.ContextDic.Add("default", new ScopedContext());
_eventAggregator.GetEvent().Subscribe(() =>
diff --git a/ACP/Views/ShellView.xaml b/ACP/Views/ShellView.xaml
index 39a0696..3b66b38 100644
--- a/ACP/Views/ShellView.xaml
+++ b/ACP/Views/ShellView.xaml
@@ -245,7 +245,15 @@ Command="{Binding GetFileStringCommand}">
-
+
+