设备连接
This commit is contained in:
@@ -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()
|
||||
{
|
||||
// 双击:把自己的名字扔出去
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user