From 0e0584b87851c56745bf73b1a961b80613dd0721 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 19 五月 2020 16:35:16 +0800
Subject: [PATCH] 2020-05-19-4

---
 ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs |   41 ++++++++++++++++++++++++++++-------------
 1 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs b/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs
index aa8dd52..6846d70 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs
@@ -27,7 +27,6 @@
                     //鍒濆鍖栧乏婊戣彍鍗�
                     roomManagement = new ListRoomViewFrom();
                     CommonPage.Instance.AddLeftView(roomManagement);
-                    roomManagement.ShowForm();
                 }
                 return roomManagement;
             }
@@ -37,6 +36,10 @@
         /// 鏄惁鍙互瑙﹀彂鐐瑰嚮浜嬩欢--鏄惁鍙互璺宠浆涓婚〉鎴块棿
         /// </summary>
         public bool CanClick = true;
+        /// <summary>
+        /// 鏄惁鍒濆鍖栧畬鎴�
+        /// </summary>
+        private bool isInitFinish = false;
         /// <summary>
         /// 褰撳墠妤煎眰id
         /// </summary>
@@ -58,8 +61,7 @@
         /// 鐢婚潰鏄剧ず
         /// </summary>
         public void ShowForm()
-        {
-            roomManagement = this;
+        {
             //鍒濆鍖栧ご閮ㄤ俊鎭�
             this.InitTopFrame();
             //鍒濆鍖栦腑閮ㄦ帶浠�
@@ -90,10 +92,8 @@
             };
 
             //鑾峰彇妤煎眰
-            if (this.curFloorId == string.Empty)
-            {
-                this.curFloorId = Config.Instance.Home.CurrentFloorId;
-            }
+            this.curFloorId = Config.Instance.Home.CurrentFloorId;
+
             var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
             if (dicFloor.Count == 0)
             {
@@ -124,8 +124,8 @@
                 {
                     this.curFloorId = floorId;
                     btnFloor.Text = dicFloor[floorId];
-                    //鍒锋柊鎴块棿鍒楄〃
-                    this.RefreshListRoom();
+                    //鍒锋柊Body瀹瑰櫒
+                    this.RefreshBodyFrame();
                 };
             };
         }
@@ -139,8 +139,8 @@
             listView.Height = bodyFrameLayout.Height;
             listView.Width = bodyFrameLayout.Width;
             bodyFrameLayout.AddChidren(listView);
-            //鍒锋柊鎴块棿鍒楄〃
-            this.RefreshListRoom();
+            //鍒锋柊Body瀹瑰櫒
+            this.RefreshBodyFrame();
         }
 
         #endregion
@@ -152,11 +152,27 @@
         /// </summary>
         public void RefreshListRoom()
         {
+            //濡傛灉杩樻病鏈夊垵濮嬪寲瀹屾垚鐣岄潰鐨勮瘽
+            if (this.isInitFinish == false)
+            {
+                this.ShowForm();
+                this.isInitFinish = true;
+                return;
+            }
             //鎶婂ご閮ㄤ篃涓�璧峰垵濮嬪寲浜�
             this.topFrameLayout.RemoveAll();
             //鍒濆鍖栧ご閮ㄤ俊鎭�
             this.InitTopFrame();
 
+            //鍒锋柊Body瀹瑰櫒
+            this.RefreshBodyFrame();
+        }
+
+        /// <summary>
+        /// 鍒锋柊Body瀹瑰櫒
+        /// </summary>
+        private void RefreshBodyFrame()
+        {
             //鍏堟竻绌�
             this.listView.frameTable.RemoveAll();
             this.listView.frameTable.Height = Application.GetRealHeight(100);
@@ -198,7 +214,6 @@
                     }
                     string oldFloorId = Config.Instance.Home.CurrentFloorId;
                     CommonPage.Instance.CloseLeftMenu();
-                    HdlRoomLogic.Current.CurrentRoom = room;
 
                     HdlThreadLogic.Current.RunThread(() =>
                     {
@@ -213,7 +228,7 @@
                                 if (oldFloorId != room.FloorId)
                                 {
                                     //妤煎眰閮藉垏鎹㈢殑璇�,鍒锋柊鏁翠釜涓婚〉
-                                    UserPage.Instance.Fresh();
+                                    UserPage.Instance.ReFreshControl();
                                     return;
                                 }
                             }

--
Gitblit v1.8.0