| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 | using MECF.Framework.UI.Client.CenterViews.Dialogs;using MECF.Framework.UI.Client.CenterViews.Editors.Recipe;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using FurnaceUI.Models;namespace FurnaceUI.Views.Recipes{    public class BoatElevatorSettingViewModel : FurnaceUIViewModelBase    {        public bool IsEnable => CGlobal.RecipeProcessEditViewEnable;//是否是View模式        private bool _rotateDirectionCW;        public bool RotateDirectionCW         {            get { return _rotateDirectionCW; }            set { _rotateDirectionCW = value;                NotifyOfPropertyChange(nameof(RotateDirectionCW));            }        }        private bool _rotateDirectionCWW;        public bool RotateDirectionCCW         {            get { return _rotateDirectionCWW; }            set            {                _rotateDirectionCWW = value;                NotifyOfPropertyChange(nameof(RotateDirectionCCW));            }        }        private Step _SelectedRecipeStep = new Step();        public Step SelectedRecipeStep         {            get { return _SelectedRecipeStep; }            set { _SelectedRecipeStep = value;NotifyOfPropertyChange(nameof(SelectedRecipeStep)); }        }        private bool _ratateAxisSpeedEditEnabled;        public bool RatateAxisSpeedEditEnabled        {            get => _ratateAxisSpeedEditEnabled;            set            {                _ratateAxisSpeedEditEnabled = value;                NotifyOfPropertyChange(nameof(RatateAxisSpeedEditEnabled));            }        }        protected override void OnViewLoaded(object view)        {            base.OnViewLoaded(view);            //RatateAxisSpeedEditEnabled = SelectedRecipeStep.RotatePosition == "Interval" ? true : false;            //if (!string.IsNullOrEmpty(SelectedRecipeStep.RotateDirection))            //{            //    if (SelectedRecipeStep.RotateDirection == "CW")            //    {            //        _rotateDirectionCW = true;            //        _rotateDirectionCWW = false;            //    }            //    else            //    {            //        _rotateDirectionCW = false;            //        _rotateDirectionCWW = true;            //    }            //}        }        public void ZAxisPositionSetCmd(string strValue)        {            //SelectedRecipeStep.ZAxisPosition = strValue;        }        public void RotationPositionSetCmd(string strValue)        {            //SelectedRecipeStep.RotatePosition = strValue;            //RatateAxisSpeedEditEnabled = SelectedRecipeStep.RotatePosition == "Interval" ? true : false;        }        public void RotationDirectionSetCmd(string strValue)         {            if (strValue == "CW")            {                //SelectedRecipeStep.RotateDirection = strValue;                _rotateDirectionCW = true;                _rotateDirectionCWW= false;            }            else             {                //SelectedRecipeStep.RotateDirection = strValue;                _rotateDirectionCW = false;                _rotateDirectionCWW = true;            }        }        public void ClosedCmd()        {            (GetView() as Window).DialogResult = false;        }        public void SAVECmd()        {            (GetView() as Window).DialogResult = true;        }    }}
 |