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" />
+
+