From 271faaf6664166dc368639b9f2e577f63f901be5 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 23 十二月 2020 22:23:57 +0800
Subject: [PATCH] 20201223-99

---
 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/RoomBinglingFloorPage.cs |   58 +++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 45 insertions(+), 13 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/RoomBinglingFloorPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/RoomBinglingFloorPage.cs
index 2544446..25f51cf 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/RoomBinglingFloorPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/RoomBinglingFloorPage.cs
@@ -92,22 +92,54 @@
 
         void RefreshFloorsListView(string floorName)
         {
-            try
+
+            var waitPage = new Loading();
+            MainPage.BaseView.AddChidren(waitPage);
+            waitPage.Start(Language.StringByID(StringId.PleaseWait));
+            new System.Threading.Thread(() =>
             {
-                var f = new SpatialInfo("FLOOR") { roomName = floorName, parentId = DB_ResidenceData.Instance.CurrentRegion.RegionID };
-                var addResult = SpatialInfo.CurrentSpatial.AddFloor(f,out f);
-                if (addResult == DAL.Server.StateCode.SUCCESS)
+                try
                 {
-                    LoadFloorRow(f);
+                    var f = new SpatialInfo("FLOOR") { roomName = floorName, parentId = DB_ResidenceData.Instance.CurrentRegion.RegionID };
+                    var addResult = SpatialInfo.CurrentSpatial.AddFloor(f, out f);
+                    if (addResult == DAL.Server.StateCode.SUCCESS)
+                    {
+                        Application.RunOnMainThread(() =>
+                        {
+                            LoadFloorRow(f);
+                        });
+                    }
                 }
-            }
-            catch (Exception ex)
-            {
-                MainPage.Log("add floor eroor : " + ex.Message);
-            }
-            int count = SpatialInfo.CurrentSpatial.FloorList.Count > 10 ? 10 : SpatialInfo.CurrentSpatial.FloorList.Count;
-            floorsListView.Height = Application.GetRealHeight(50 * count);
-            contentView.Height = Application.GetRealHeight(50 * (count + 1));
+                catch { }
+                finally
+                {
+                    Application.RunOnMainThread(() => {
+                        waitPage.Hide();
+                        waitPage.RemoveFromParent();
+                        int count = SpatialInfo.CurrentSpatial.FloorList.Count > 10 ? 10 : SpatialInfo.CurrentSpatial.FloorList.Count;
+                        floorsListView.Height = Application.GetRealHeight(50 * count);
+                        contentView.Height = Application.GetRealHeight(50 * (count + 1));
+                    });
+                }
+            })
+            { IsBackground = true }.Start();
+
+            //try
+            //{
+            //    var f = new SpatialInfo("FLOOR") { roomName = floorName, parentId = DB_ResidenceData.Instance.CurrentRegion.RegionID };
+            //    var addResult = SpatialInfo.CurrentSpatial.AddFloor(f,out f);
+            //    if (addResult == DAL.Server.StateCode.SUCCESS)
+            //    {
+            //        LoadFloorRow(f);
+            //    }
+            //}
+            //catch (Exception ex)
+            //{
+            //    MainPage.Log("add floor eroor : " + ex.Message);
+            //}
+            //int count = SpatialInfo.CurrentSpatial.FloorList.Count > 10 ? 10 : SpatialInfo.CurrentSpatial.FloorList.Count;
+            //floorsListView.Height = Application.GetRealHeight(50 * count);
+            //contentView.Height = Application.GetRealHeight(50 * (count + 1));
         }
 
         public void LoadPage()

--
Gitblit v1.8.0