namespace BPASmartClient.MorkCL.ViewModel { public class FryPanSelectViewModel : NotifyBase { public FryPanSelectViewModel() { SelectFryPanCommand = new((object i) => { if (int.TryParse(i.ToString(), out int res)) { switch (res) { case 1: DeviceType = EDeviceType.炒锅1; break; case 2: DeviceType = EDeviceType.炒锅2; break; default: DeviceType = EDeviceType.无; break; } ActionManage.GetInstance.Send(true, "CloseFryPanSelectView"); } }); CloseCommand = new(() => { ActionManage.GetInstance.Send(false, "CloseFryPanSelectView"); }); } /// 选择命令。 public BPARelayCommand SelectFryPanCommand { get; set; } public BPARelayCommand CloseCommand { get; set; } public static EDeviceType DeviceType { get; set; } } }