From 80a2cbd80be3a1124ea03b7763724ddbe87f6d17 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 11:29:08 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AD=90=E7=A8=8B=E5=BA=8F=E4=BD=BF=E7=94=A8?=
=?UTF-8?q?=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 | 2 +
.../ViewModels/StepsManagerViewModel.cs | 131 +++++++++++++++++-
TestingModule/Views/StepsManager.xaml | 35 +++--
UIShare/GlobalVariable/ScopedContext.cs | 66 ++++++++-
UIShare/GlobalVariable/StepRunning.cs | 36 +++++
UIShare/PubEvent/SubProgramNavigateEvent.cs | 34 +++++
7 files changed, 306 insertions(+), 15 deletions(-)
create mode 100644 UIShare/PubEvent/SubProgramNavigateEvent.cs
diff --git a/ACP/ViewModels/ShellViewModel.cs b/ACP/ViewModels/ShellViewModel.cs
index e4bfeec..af76648 100644
--- a/ACP/ViewModels/ShellViewModel.cs
+++ b/ACP/ViewModels/ShellViewModel.cs
@@ -44,6 +44,16 @@ namespace ACP.ViewModels
private readonly DispatcherTimer _uiRefreshTimer;
#endregion
+ #region 子程序导航
+
+ ///
+ /// 当前台架是否可以返回上一级
+ ///
+ public bool CanGoBack => CurrentContext?.CanGoBack ?? false;
+
+
+ #endregion
+
#region 属性
public string Title
{
@@ -237,6 +247,7 @@ namespace ACP.ViewModels
RaisePropertyChanged(nameof(RunIcon));
RaisePropertyChanged(nameof(RunningTime));
RaisePropertyChanged(nameof(IsTerminate));
+ RaisePropertyChanged(nameof(CanGoBack));
}
#region 命令处理与事件
@@ -519,6 +530,9 @@ namespace ACP.ViewModels
targetContext.IsTerminate = false;
}
+ // 清空子程序导航栈,回到根程序
+ targetContext.ResetNavigation();
+
if (_globalInfo.CurrentScope == runningScope) RefreshAllContextProperties();
}
@@ -601,6 +615,7 @@ namespace ACP.ViewModels
targetContext.Program.Parameters.Clear();
targetContext.Program.StepCollection.Clear();
targetContext.Program.ErrorStepCollection.Clear();
+ targetContext.ResetNavigation();
foreach (var item in CurrentConfig.ParameterList)
{
var param = CurrentConfig.SharedParameterList.FirstOrDefault(x => x.ParameterName == item.Name);
@@ -665,7 +680,7 @@ namespace ACP.ViewModels
targetContext.Program.StepCollection = program.StepCollection;
targetContext.Program.ErrorStepCollection = program.ErrorStepCollection;
targetContext.CurrentFilePath = filePath;
-
+ targetContext.ResetNavigation();
foreach (var item in CurrentConfig.SharedParameterList)
{
var parameter = targetContext?.Program?.Parameters?.FirstOrDefault(x => x.Name == item.ParameterName);
diff --git a/ACP/Views/ShellView.xaml b/ACP/Views/ShellView.xaml
index 8217e35..39a0696 100644
--- a/ACP/Views/ShellView.xaml
+++ b/ACP/Views/ShellView.xaml
@@ -244,6 +244,8 @@ Command="{Binding GetFileStringCommand}">
Foreground="Black" />
+
+