From 2450c12c825ad4d78d1572da2fa421706db2df2f Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 18 六月 2020 16:01:14 +0800
Subject: [PATCH] 新代码

---
 ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs |   49 +++++++++++++++++++++++++++++++++----------------
 1 files changed, 33 insertions(+), 16 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs b/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs
index e916bc0..3b2d07d 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs
@@ -1,7 +1,6 @@
 锘縰sing System;
 using System.Collections.Generic;
 using Shared.Common;
-using Shared.Phone.Device.Category;
 using Shared.Phone.Device.CommonForm;
 using Shared.Phone.UserCenter;
 using Shared.Phone.UserView;
@@ -28,7 +27,6 @@
                     //鍒濆鍖栧乏婊戣彍鍗�
                     roomManagement = new ListRoomViewFrom();
                     CommonPage.Instance.AddLeftView(roomManagement);
-                    roomManagement.ShowForm();
                 }
                 return roomManagement;
             }
@@ -38,6 +36,10 @@
         /// 鏄惁鍙互瑙﹀彂鐐瑰嚮浜嬩欢--鏄惁鍙互璺宠浆涓婚〉鎴块棿
         /// </summary>
         public bool CanClick = true;
+        /// <summary>
+        /// 鏄惁鍒濆鍖栧畬鎴�
+        /// </summary>
+        private bool isInitFinish = false;
         /// <summary>
         /// 褰撳墠妤煎眰id
         /// </summary>
@@ -59,8 +61,7 @@
         /// 鐢婚潰鏄剧ず
         /// </summary>
         public void ShowForm()
-        {
-            roomManagement = this;
+        {
             //鍒濆鍖栧ご閮ㄤ俊鎭�
             this.InitTopFrame();
             //鍒濆鍖栦腑閮ㄦ帶浠�
@@ -92,6 +93,7 @@
 
             //鑾峰彇妤煎眰
             this.curFloorId = Config.Instance.Home.CurrentFloorId;
+
             var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
             if (dicFloor.Count == 0)
             {
@@ -113,7 +115,7 @@
             btnIconContr.ButtonClickEvent += (sender, e) =>
             {
                 //妤煎眰鑿滃崟
-                var floors = new SelectFloor();
+                var floors = new Category.SelectFloorForm();
                 AddChidren(floors);
                 floors.changeFloor = false;
                 floors.CurFloorId = curFloorId;
@@ -122,8 +124,8 @@
                 {
                     this.curFloorId = floorId;
                     btnFloor.Text = dicFloor[floorId];
-                    //鍒锋柊鎴块棿鍒楄〃
-                    this.RefreshListRoom();
+                    //鍒锋柊Body瀹瑰櫒
+                    this.RefreshBodyFrame();
                 };
             };
         }
@@ -137,8 +139,8 @@
             listView.Height = bodyFrameLayout.Height;
             listView.Width = bodyFrameLayout.Width;
             bodyFrameLayout.AddChidren(listView);
-            //鍒锋柊鎴块棿鍒楄〃
-            this.RefreshListRoom();
+            //鍒锋柊Body瀹瑰櫒
+            this.RefreshBodyFrame();
         }
 
         #endregion
@@ -150,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);
@@ -196,7 +214,6 @@
                     }
                     string oldFloorId = Config.Instance.Home.CurrentFloorId;
                     CommonPage.Instance.CloseLeftMenu();
-                    HdlRoomLogic.Current.CurrentRoom = room;
 
                     HdlThreadLogic.Current.RunThread(() =>
                     {
@@ -211,12 +228,12 @@
                                 if (oldFloorId != room.FloorId)
                                 {
                                     //妤煎眰閮藉垏鎹㈢殑璇�,鍒锋柊鏁翠釜涓婚〉
-                                    UserPage.Instance.Fresh();
+                                    UserPage.Instance.ReFreshControl();
                                     return;
                                 }
                             }
                             //濡傛灉鍙槸鍒囨崲褰撳墠妤煎眰鐨勫叾浠栨埧闂�,鍒欏彧婊戝姩涓婚〉鐨勬粦鍔ㄦ帶浠�
-                            this.LoadFormMethodByName("HomeMainPageForm", "SetRoomPageViewSelect", room);
+                            HomeMainPageForm.Instance?.SetRoomPageViewSelect(room);
                         });
                     });
                 };
@@ -237,7 +254,7 @@
         private void InitRoomCardControl(int XX, int YY)
         {
             //妗屽竷鎺т欢
-            var frameBack = new FrameLayoutControl();
+            var frameBack = new FrameLayoutStatuControl();
             frameBack.X = XX;
             frameBack.Y = YY;
             frameBack.Width = this.GetPictrueRealSize(495);
@@ -254,14 +271,14 @@
             picBackGroud.Gravity = Gravity.CenterHorizontal;
             picBackGroud.Radius = (uint)this.GetPictrueRealSize(29);
             picBackGroud.BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor3;
-            frameBack.AddChidren(picBackGroud, ChidrenBindMode.BindEventOnly);
+            frameBack.AddChidren(picBackGroud, ChidrenBindMode.BindEvent);
 
             //鏈垎閰嶅浘鏍�
             var btnIcon = new PicViewControl(92, 72);
             btnIcon.X = this.GetPictrueRealSize(129);
             btnIcon.Y = this.GetPictrueRealSize(141);
             btnIcon.UnSelectedImagePath = "Room/NoNameRoom.png";
-            frameBack.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
+            frameBack.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
 
             //鏈垎閰�
             var btnName = new NormalViewControl(141, 84, true);
@@ -270,7 +287,7 @@
             btnName.IsBold = true;
             btnName.TextColor = UserCenterColor.Current.White;
             btnName.TextID = R.MyInternationalizationString.Unallocated;
-            frameBack.AddChidren(btnName, ChidrenBindMode.BindEventOnly);
+            frameBack.AddChidren(btnName, ChidrenBindMode.BindEvent);
             frameBack.ButtonClickEvent += (sender, e) =>
             {
                 if (this.CanClick == false)

--
Gitblit v1.8.0