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