设备初始化
This commit is contained in:
@@ -61,7 +61,6 @@ namespace SettingModule.ViewModels
|
||||
#region 命令
|
||||
public ICommand RefreshCommand { get; }
|
||||
public ICommand SaveCommand { get; }
|
||||
public ICommand ResetCommand { get; }
|
||||
public ICommand OpenConnectionConfigCommand { get; }
|
||||
#endregion
|
||||
#region 私有字段
|
||||
@@ -80,7 +79,6 @@ namespace SettingModule.ViewModels
|
||||
_globalInfo = container.Resolve<GlobalInfo>();
|
||||
RefreshCommand = new DelegateCommand(OnExpand);
|
||||
SaveCommand = new DelegateCommand(OnSave);
|
||||
ResetCommand = new DelegateCommand(OnReset);
|
||||
OpenConnectionConfigCommand = new DelegateCommand(OnOpenConnectionConfig);
|
||||
}
|
||||
|
||||
@@ -132,15 +130,7 @@ namespace SettingModule.ViewModels
|
||||
}
|
||||
|
||||
/// <summary>重置当前选中设备的配置(占位)。</summary>
|
||||
private void OnReset()
|
||||
{
|
||||
if (SelectedDevice == null)
|
||||
{
|
||||
StatusMessage = "无可重置的设备";
|
||||
return;
|
||||
}
|
||||
StatusMessage = $"已重置设备 [{SelectedDevice.DeviceName}] 的配置";
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 打开"连接配置"对话框。按 SelectedDevice.ConnectionType 决定开 TCP 还是串口对话框。
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
<Run Text="{Binding SelectedDevice.DeviceName, FallbackValue=未选中}"/>
|
||||
</TextBlock>
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||||
<Button Content="重置" Command="{Binding ResetCommand}" Padding="12,4"/>
|
||||
|
||||
<Button Content="保存" Command="{Binding SaveCommand}" Padding="12,4" Margin="6,0,0,0"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user