wxr
2022-11-21 af224fed5dea064e306a0591dcd080655e38ec18
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/MechanicalArmPage.cs
@@ -132,21 +132,31 @@
            //    }.Show(MainPage.BaseView);
            //    return;
            //}
            this.btnPictrue.CanClick = false;
            this.btnSwitch.CanClick = false;
            string statu = this.btnSwitch.IsSelected == true ? "off" : "on";
            HdlThreadLogic.Current.RunThread(() =>
            string tipMsg = "确定打开?";
            if (this.btnSwitch.IsSelected)
            {
                var dic = new Dictionary<string, string>();
                dic.Add(FunctionAttributeKey.OnOff, statu);
                Control.Ins.SendWriteCommand(this.device, dic, true);
                HdlThreadLogic.Current.RunMain(() =>
                tipMsg = "确定关闭?";
            }
            Action action = () => {
                this.btnPictrue.CanClick = false;
                this.btnSwitch.CanClick = false;
                HdlThreadLogic.Current.RunThread(() =>
                {
                    this.btnPictrue.CanClick = true;
                    this.btnSwitch.CanClick = true;
                    var dic = new Dictionary<string, string>();
                    dic.Add(FunctionAttributeKey.OnOff, statu);
                    Control.Ins.SendWriteCommand(this.device, dic, true);
                    HdlThreadLogic.Current.RunMain(() =>
                    {
                        this.btnPictrue.CanClick = true;
                        this.btnSwitch.CanClick = true;
                    });
                });
            });
            };
            new PublicAssmebly().TipOptionMsg(StringId.EmptyString, tipMsg, action);
        }
        #endregion