using System.Windows.Input;
using SparkClient.Model.Helper;
using SparkClient.ViewModel.BaseWindow;
using SparkClient.ViewModel.Configuration.SettingsPages;
using SparkClient.Model.Attributes;
namespace SparkClient.ViewModel.Configuration;
public class ConfigMenuPageVM : BaseViewModel
{
public ICommand CloseCommand { get; }
public ICommand LevelConfigCommand { get; }
public ICommand AlgorithmConfigCommand { get; }
public ICommand CutConfigCommand { get; }
public ICommand SettingConfigCommand { get; }
public ConfigMenuPageVM()
{
CloseCommand = new RelayCommand(CloseVM);
LevelConfigCommand = new RelayCommand(LevelConfig);
AlgorithmConfigCommand = new RelayCommand(AlgorithmConfig);
CutConfigCommand = new RelayCommand(CutConfig);
SettingConfigCommand = new RelayCommand(SettingConfig);
}
///
/// 关闭并退回至上一页面
///
///
[Log]
public void CloseVM(object parameter)
{
WindowManager.mainViewModel.Content = WindowManager.PreviousVM();
}
///
/// 打开定级配置页面
///
///
[Log]
public void LevelConfig(object parameter)
{
BaseControlVM vm = new BaseControlVM(new LevelConfigVM(null), MultilingualHelper.getString("LevelConfig"));
vm.ShowFunctionButton = System.Windows.Visibility.Hidden;
WindowManager.mainViewModel.Content = vm;
WindowManager.openContent.Add(vm);
}
///
/// 打开算法配置页面
///
///
[Log]
public void AlgorithmConfig(object parameter)
{
BaseControlVM vm = new BaseControlVM(new AlgorithmConfigVM(), MultilingualHelper.getString("AlgorithmConfig"));
vm.ShowFunctionButton = System.Windows.Visibility.Hidden;
WindowManager.mainViewModel.Content = vm;
WindowManager.openContent.Add(vm);
}
///
/// 打开切工仪配置页面
///
///
[Log]
public void CutConfig(object parameter)
{
BaseControlVM vm = new BaseControlVM(new CutConfigVM(), MultilingualHelper.getString("CutConfig"));
vm.ShowFunctionButton = System.Windows.Visibility.Hidden;
WindowManager.mainViewModel.Content = vm;
WindowManager.openContent.Add(vm);
}
[Log]
public void SettingConfig(object parameter)
{
BaseControlVM vm = new BaseControlVM(new SettingBaseVM(), MultilingualHelper.getString("SystemSetting"));
WindowManager.mainViewModel.Content = vm;
WindowManager.openContent.Add(vm);
}
}