wxr
2023-06-06 592974441a4df95fffd9167c90192da1a390b1c2
HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs
@@ -12,6 +12,8 @@
        {
            LoadEvent_ChangeFunctionName ();
            SkipChooseRoomPage();
            DelDeviceEvent();
        }
        /// <summary>
@@ -77,5 +79,45 @@
            }
                
        }
        /// <summary>
        /// 解绑设备的事件
        /// </summary>
        void DelDeviceEvent()
        {
            EventHandler<MouseEventArgs> ClickEvent = (sener, e) =>
            {
                new HDL_ON.UI.Music.View.TipView().TipBox(-1, StringId.AreYouSureToDeleteThisDevice, () =>
                {
                    UI2.FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.DelDevice(this.function, (isBool) =>
                    {
                        Application.RunOnMainThread(() =>
                        {
                            if (!isBool)
                            {
                                new Tip()
                                {
                                    CloseTime = 1,
                                    Text = Language.StringByID(StringId.delFail),
                                    Direction = AMPopTipDirection.None,
                                }.Show(bodyView);
                                return;
                            }
                            //删除本地文件
                            UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.DeleteFunction(this.function);
                            this.RemoveFromParent();
                            this.actionDel?.Invoke();
                        });
                    });
                });
            };
            this.delView.MouseUpEventHandler += ClickEvent;
            this.delTextBtn.MouseUpEventHandler += ClickEvent;
            this.delRightBtn.MouseUpEventHandler += ClickEvent;
        }
    }
}