✨ feat: 初始化 PCB 检测 WPF 应用程序
* 创建 AxiOmron.PcbCheck 项目主框架及解决方案 * 添加 Dashboard 和系统设置页面 * 实现 Modbus TCP PLC、扫码枪、SFTP 查询等核心服务 * 集成 Andon 报警、工作流托管服务与日志配置 * 补充项目文档和 UI 设计规范
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
using AxiOmron.PcbCheck.Options;
|
||||
using AxiOmron.PcbCheck.ViewModels;
|
||||
|
||||
namespace AxiOmron.PcbCheck.DesignTime;
|
||||
|
||||
/// <summary>
|
||||
/// 为 XAML 设计器提供基于真实 ViewModel 的设计时定位器。
|
||||
/// </summary>
|
||||
public sealed class DesignTimeViewModelLocator
|
||||
{
|
||||
private readonly DesignTimeAppStateStore _appStateStore = new();
|
||||
private readonly DesignTimeDispatcherService _dispatcherService = new();
|
||||
private readonly DesignTimeWorkflowControlService _workflowControlService = new();
|
||||
private readonly DesignTimeAppConfigService _appConfigService = new();
|
||||
private MainWindowViewModel? _mainWindowViewModel;
|
||||
private SystemSettingViewModel? _systemSettingViewModel;
|
||||
|
||||
/// <summary>
|
||||
/// 获取首页设计时视图模型。
|
||||
/// </summary>
|
||||
public MainWindowViewModel MainWindowViewModel
|
||||
=> _mainWindowViewModel ??= CreateMainWindowViewModel();
|
||||
|
||||
/// <summary>
|
||||
/// 获取系统设置设计时视图模型。
|
||||
/// </summary>
|
||||
public SystemSettingViewModel SystemSettingViewModel
|
||||
=> _systemSettingViewModel ??= new SystemSettingViewModel(_appConfigService);
|
||||
|
||||
/// <summary>
|
||||
/// 创建首页设计时视图模型。
|
||||
/// </summary>
|
||||
/// <returns>填充了设计时演示数据的真实视图模型实例。</returns>
|
||||
private MainWindowViewModel CreateMainWindowViewModel()
|
||||
{
|
||||
AppConfig config = _appConfigService.Load();
|
||||
return new MainWindowViewModel(_appStateStore, _dispatcherService, _workflowControlService, config);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user