From f23ad1b3f9f6193f35f72104d690b21dc67d5c1f Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 06 七月 2020 12:35:25 +0800
Subject: [PATCH] 去掉了访问外网的异步

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs |   67 +++++++++++++++++++++++++--------
 1 files changed, 50 insertions(+), 17 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
index 5609b22..cc6932b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceObjectControl.cs
@@ -160,27 +160,60 @@
                 return;
             }
             this.sensorPushing = true;
-            //璁惧
-            uint oldTextColor1 = btnDeviceName.TextColor;
-            btnDeviceName.TextColor = UserCenterColor.Current.TextOrangeColor;
-            //璁惧鎴块棿
-            uint oldTextColor2 = btnDeviceRoom.TextColor;
-            btnDeviceRoom.TextColor = UserCenterColor.Current.TextOrangeColor;
+
             HdlThreadLogic.Current.RunThread(() =>
             {
-                System.Threading.Thread.Sleep(5000);
-                HdlThreadLogic.Current.RunMain(() =>
+                //闂儊5绉�,闂撮殧400姣
+                int count = 5000 / 400;
+                bool isOpen = false;
+                while (this.Parent != null && count >= 0)
                 {
-                    if (btnDeviceName.Parent != null)
+                    //闂儊鐗规晥
+                    HdlThreadLogic.Current.RunMain(() =>
                     {
-                        //璁惧
-                        btnDeviceName.TextColor = oldTextColor1;
-                        //璁惧鎴块棿
-                        btnDeviceRoom.TextColor = oldTextColor2;
-                    }
-                    this.sensorPushing = false;
-                }, ShowErrorMode.NO);
-            });
+                        isOpen = !isOpen;
+                        this.SwitchRowStatuAppeal(isOpen);
+                    }, ShowErrorMode.NO);
+                    System.Threading.Thread.Sleep(400);
+                    count--;
+                }
+                if (this.Parent != null && isOpen == true)
+                {
+                    HdlThreadLogic.Current.RunMain(() =>
+                    {
+                        //缁撴潫鏃�,榛樿涓烘棤鐗规晥
+                        this.SwitchRowStatuAppeal(false);
+                    }, ShowErrorMode.NO);
+                }
+                this.sensorPushing = false;
+
+            }, ShowErrorMode.NO);
+        }
+
+        /// <summary>
+        /// 鍒囨崲琛岄棯鐑佺壒鏁�
+        /// </summary>
+        /// <param name="isOpen"></param>
+        private void SwitchRowStatuAppeal(bool isOpen)
+        {
+            if (isOpen == true)
+            {
+                //鍥炬爣
+                btnIcon.IsSelected = true;
+                //璁惧
+                btnDeviceName.TextColor = UserCenterColor.Current.TextOrangeColor;
+                //璁惧鎴块棿
+                btnDeviceRoom.TextColor = UserCenterColor.Current.TextOrangeColor;
+            }
+            else
+            {
+                //鍥炬爣
+                btnIcon.IsSelected = false;
+                //璁惧
+                btnDeviceName.TextColor = UserCenterColor.Current.TextColor1;
+                //璁惧鎴块棿
+                btnDeviceRoom.TextColor = UserCenterColor.Current.TextGrayColor1;
+            }
         }
 
         #endregion

--
Gitblit v1.8.0