陈嘉乐
2021-03-25 1cba5ec1959f9012c66f96254afb3206904ff671
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/SetPir.cs
@@ -10,19 +10,16 @@
    {
        public SetPir()
        {
            Tag = "PirMain";
            Tag = "PirView";
        }
        Action backAction;
        public void Show(Action action)
        public void Show()
        {
            backAction = action;
            #region 界面布局
            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
            Intelligence.Automation.LogicView.TopView topView = new Intelligence.Automation.LogicView.TopView();
            this.AddChidren(topView.FLayoutView());
            topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
            {
                //action();
                RemoveFromParent();
            };
            topView.topNameBtn.TextID = StringId.setlogic;
@@ -113,16 +110,8 @@
                            Pir.pirDeviceList.Remove(Pir.currPir);
                        }
                        dialog.Close();
                        action();
                        this.RemoveFromParent();
                        for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--)
                        {
                            var view = MainPage.BasePageView.GetChildren(i);
                            if (view.GetType() == typeof(PirMain))
                            {
                                view.RemoveFromParent();
                            }
                        }
                        Method.RemoveView("PirMain");
                    }, "删除", "dialog", null, dialog);
                }, () =>
@@ -141,8 +130,10 @@
        /// </summary>
        public override void RemoveFromParent()
        {
            backAction();
            //刷新PirMain界面
            Method.RefreshView("PirMain");
            base.RemoveFromParent();
        }
    }
}