From fc53a944dda446dd8d86a036c7a858ff4b874950 Mon Sep 17 00:00:00 2001 From: czj Date: Fri, 5 Jun 2026 11:54:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=95=8C=E9=9D=A2=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SettingModule/ViewModels/SettingViewModel.cs | 16 +- SettingModule/Views/SettingView.xaml | 635 +++++++++++-------- UIShare/GlobalVariable/SystemConfig.cs | 14 +- 3 files changed, 400 insertions(+), 265 deletions(-) diff --git a/SettingModule/ViewModels/SettingViewModel.cs b/SettingModule/ViewModels/SettingViewModel.cs index f4999bd..38c0da9 100644 --- a/SettingModule/ViewModels/SettingViewModel.cs +++ b/SettingModule/ViewModels/SettingViewModel.cs @@ -8,7 +8,13 @@ using UIShare.ViewModelBase; namespace SettingModule.ViewModels { - + /// + /// 设置界面 VM —— 复用与 RecordView/MonitorView 相同的范式: + /// - ScopedContext 隔离(每工位独立一份) + /// - 双击展开(ExpandViewEvent + GlobalInfo.CurrentScope) + /// - OnNavigatedTo 取 Name 参数作为工位标题 + /// 设备数据来源:注入的 SystemConfig.DeviceList(Scoped 注入,每工位一份)。 + /// public class SettingViewModel : NavigateViewModelBase, IRegionMemberLifetime, IDisposable { #region 私有字段 @@ -16,6 +22,14 @@ namespace SettingModule.ViewModels private readonly SystemConfig _systemConfig; #endregion + #region 系统参数(暴露给 XAML 绑定) + /// + /// 公开 SystemConfig 实例供 XAML 绑定(Tab 2"系统参数"页用)。 + /// 这是 Scoped 实例,每个工位一份,互不影响。 + /// + public SystemConfig SystemConfig => _systemConfig; + #endregion + #region 隔离 / 标题 public bool KeepAlive => true; public ScopedContext _scopedContext { get; } diff --git a/SettingModule/Views/SettingView.xaml b/SettingModule/Views/SettingView.xaml index 84a2ed7..62c2887 100644 --- a/SettingModule/Views/SettingView.xaml +++ b/SettingModule/Views/SettingView.xaml @@ -16,18 +16,14 @@ - - - - - - - - - - - - - - - + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + +