| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 | using Aitex.Core.Common.DeviceData;using Caliburn.Micro;using Caliburn.Micro.Core;using MECF.Framework.Common.DataCenter;using MECF.Framework.Common.OperationCenter;using MECF.Framework.Common.RecipeCenter;using MECF.Framework.UI.Client.CenterViews.Configs.SystemConfig;using MECF.Framework.UI.Client.CenterViews.Dialogs;using MECF.Framework.UI.Client.CenterViews.Editors.Recipe;using MECF.Framework.UI.Core.Control;using System;using System.Collections.Generic;using System.Collections.ObjectModel;using System.Linq;using System.Windows;using System.Windows.Controls;using FurnaceUI.Models;namespace FurnaceUI.Client.Dialog{    public class RecipePressWaitValveAngleViewModel : FurnaceUIViewModelBase    {        private RecipePressWaitValveAngleView _view;        public bool IsSave { get; set; } = false;        public Step SelectedStep { get; set; }        public bool IsEnable => CGlobal.RecipeProcessEditViewEnable;//是否是View模式        public RecipePressWaitValveAngleViewModel()        {        }        protected override void OnViewLoaded(object view)        {            _view = (RecipePressWaitValveAngleView)view;            base.OnViewLoaded(view);            LoadData();        }        private void LoadData()        {            if (SelectedStep.PressWaitUnit.Value != "%" && SelectedStep.PressWaitUnit.Value != "%d")            {                SelectedStep.PressWaitUnit.Value = "%";            }            switch (SelectedStep.PressWaitUnit.Value)            {                case "%":                    _view.RdoPercent.IsChecked = true;                    break;                case "%d":                    _view.RdoPercentd.IsChecked = true;                    break;                default:                    _view.RdoPercent.IsChecked = true;                    break;            }        }              public void GASSettingCancel()        {            ((Window)GetView()).DialogResult = false;        }        public void ButtonSelectClick(string cmd)        {            switch (cmd.ToLower())            {                case "%":                    SelectedStep.PressWaitUnit.SetValue("%");                    break;                case "%d":                    SelectedStep.PressWaitUnit.SetValue("%d");                    break;                default:                    break;            }            IsSave = true;            ((Window)GetView()).DialogResult = true;        }    }}
 |