设备连接

This commit is contained in:
hsc
2026-06-11 17:25:59 +08:00
parent a9ee9e974e
commit a62b6cbc8f
15 changed files with 144 additions and 35 deletions

View File

@@ -46,6 +46,7 @@ namespace MainModule.ViewModels
public ICommand RefreshCommand { get; set; }
public ICommand BackToProtocolCommand { get; set; }
public ICommand LoadedCommand { get; set; }
public AutomatedTestingViewModel(IContainerExtension container) : base(container)
{
@@ -75,8 +76,10 @@ namespace MainModule.ViewModels
ParametersManagerVM = _scope.Resolve<ParametersManagerViewModel>();
RefreshCommand = new DelegateCommand(OnRefresh);
BackToProtocolCommand = new DelegateCommand(OnBackToProtocol);
LoadedCommand = new AsyncDelegateCommand(OnLoad);
}
public void Dispose()
{
// 1. 如果 TestStatus 为空,说明还没走到 OnNavigatedTo 赋值,直接释放 scope 即可
@@ -114,6 +117,11 @@ namespace MainModule.ViewModels
}
}
#region
private async Task OnLoad()
{
await _deviceManager.ConnectAllDevices();
}
private void OnRefresh()
{
// 双击:把自己的名字扔出去

View File

@@ -15,6 +15,11 @@
<UserControl.Resources>
<converters:LessThanConverter x:Key="LessThanConverter" />
</UserControl.Resources>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding LoadedCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<Border >
<i:Interaction.Behaviors>
<b:MouseDoubleClickBehavior