From 002bb6950a15e703e2ad6ef7b2b4c5d80c4ee64b Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 22 三月 2021 17:56:07 +0800
Subject: [PATCH] 2021-3-22-2

---
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs |   30 ++++++++++++++++++++----------
 1 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs
index 801b039..2b35cc8 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs
@@ -90,13 +90,13 @@
             this.AddChidren(namePatchView.FLayoutView());
             namePatchView.btnText1.TextID = StringId.yaokongqimingcheng;
             namePatchView.btnText2.Text = control.name;
-          
+
             //鎵�灞炲尯鍩�
             View.PatchView quyuPatchView = new View.PatchView();
             quyuPatchView.frameLayout.Y = namePatchView.frameLayout.Bottom;
             this.AddChidren(quyuPatchView.FLayoutView());
             quyuPatchView.btnText1.TextID = StringId.suoshuquyu;
-            quyuPatchView.btnText2.Text=Intelligence.Automation.LogicMethod.GetGetRoomName(function);
+            quyuPatchView.btnText2.Text = Intelligence.Automation.LogicMethod.GetGetRoomName(function);
 
             //缁х画娣诲姞
             Button addBtn = new Button
@@ -154,11 +154,13 @@
                 if (bool_library)
                 {
                     this.RemoveFromParent();
+                    RefreshView();
                 }
                 else
                 {
                     Method method = new Method();
-                    method.AddControl(this, (controlDevice) => { 
+                    method.AddControl(this, (controlDevice) =>
+                    {
                         AddButton addButton = new AddButton();
                         MainPage.BasePageView.AddChidren(addButton);
                         addButton.Show(controlDevice);
@@ -171,16 +173,24 @@
             {
                 //绉婚櫎鎵�鏈夌晫闈�
                 MainPage.BasePageView.RemoveViewByTag("PirView");
-                //绉婚櫎绾㈠瀹濇牴鐣岄潰
-                MainPage.BasePageView.RemoveViewByTag("PirMain");
-                //閲嶆柊鍔犺浇鐣岄潰
-                var page = new PirMain();
-                MainPage.BasePageView.AddChidren(page);
-                page.Show();
-                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                RefreshView();
 
             };
             #endregion
         }
+        /// <summary>
+        /// 鍒锋柊绾㈠瀹濅富鐣岄潰
+        /// </summary>
+        void RefreshView()
+        {
+
+            //绉婚櫎绾㈠瀹濇牴鐣岄潰
+            MainPage.BasePageView.RemoveViewByTag("PirMain");
+            //閲嶆柊鍔犺浇鐣岄潰
+            var page = new PirMain();
+            MainPage.BasePageView.AddChidren(page);
+            page.Show();
+            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+        }
     }
 }

--
Gitblit v1.8.0