设备列表
This commit is contained in:
@@ -47,7 +47,7 @@ namespace MainModule.ViewModels
|
||||
public ICommand RefreshCommand { get; set; }
|
||||
public ICommand BackToProtocolCommand { get; set; }
|
||||
|
||||
public AutomatedTestingViewModel(IContainerProvider container) : base(container)
|
||||
public AutomatedTestingViewModel(IContainerExtension container) : base(container)
|
||||
{
|
||||
// 每个 AutomatedTestingViewModel 实例创建独立的容器作用域
|
||||
_scope = container.CreateScope();
|
||||
@@ -55,7 +55,7 @@ namespace MainModule.ViewModels
|
||||
// 在该作用域内解析 ScopedContext —— 当前作用域唯一
|
||||
_scopedContext = _scope.Resolve<ScopedContext>();
|
||||
_stepRunning = _scope.Resolve<StepRunning>();
|
||||
_systemConfig = _scope.Resolve<SystemConfig>();;
|
||||
_systemConfig = _scope.Resolve<SystemConfig>();
|
||||
// 关键:从同一个 _scope 解析 5 个子 VM,DI 会把同一个 ScopedContext 注入它们
|
||||
CommandTreeVM = _scope.Resolve<CommandTreeViewModel>();
|
||||
StepsManagerVM = _scope.Resolve<StepsManagerViewModel>();
|
||||
@@ -64,7 +64,6 @@ namespace MainModule.ViewModels
|
||||
ParametersManagerVM = _scope.Resolve<ParametersManagerViewModel>();
|
||||
RefreshCommand = new DelegateCommand(OnRefresh);
|
||||
BackToProtocolCommand = new DelegateCommand(OnBackToProtocol);
|
||||
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
Reference in New Issue
Block a user