You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.7 KiB

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);
}
/// <summary>
/// 关闭并退回至上一页面
/// </summary>
/// <param name="parameter"></param>
[Log]
public void CloseVM(object parameter)
{
WindowManager.mainViewModel.Content = WindowManager.PreviousVM();
}
/// <summary>
/// 打开定级配置页面
/// </summary>
/// <param name="parameter"></param>
[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);
}
/// <summary>
/// 打开算法配置页面
/// </summary>
/// <param name="parameter"></param>
[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);
}
/// <summary>
/// 打开切工仪配置页面
/// </summary>
/// <param name="parameter"></param>
[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);
}
}