From 64390bc739286477167e186f1f2b40a27a73a9a5 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期二, 02 三月 2021 17:31:01 +0800
Subject: [PATCH] 20210302-1

---
 HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs |   72 ++++++++++++++++++++---------------
 1 files changed, 41 insertions(+), 31 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs
index 848bffa..1579e5b 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs
@@ -21,22 +21,22 @@
                 {
                     if (uCurtain.trait_on_off.curValue.ToString() == "stop")
                     {
-                        bodyView.btnCurtainOpen.IsSelected = false;
-                        bodyView.btnCurtainClose.IsSelected = false;
-                        bodyView.btnCurtainStop.IsSelected = true;
+                        //bodyView.btnCurtainOpen.IsSelected = false;
+                        //bodyView.btnCurtainClose.IsSelected = false;
+                        //bodyView.btnCurtainStop.IsSelected = true;
                     }
                     else if (uCurtain.trait_on_off.curValue.ToString() == "on")
                     {
-                        bodyView.btnCurtainOpen.IsSelected = true;
-                        bodyView.btnCurtainClose.IsSelected = false;
-                        bodyView.btnCurtainStop.IsSelected = false;
+                        //bodyView.btnCurtainOpen.IsSelected = true;
+                        //bodyView.btnCurtainClose.IsSelected = false;
+                        //bodyView.btnCurtainStop.IsSelected = false;
                         bodyView.btnCurtainBgIcon.IsSelected = true;
                     }
                     else if (uCurtain.trait_on_off.curValue.ToString() == "off")
                     {
-                        bodyView.btnCurtainOpen.IsSelected = false;
-                        bodyView.btnCurtainClose.IsSelected = true;
-                        bodyView.btnCurtainStop.IsSelected = false;
+                        //bodyView.btnCurtainOpen.IsSelected = false;
+                        //bodyView.btnCurtainClose.IsSelected = true;
+                        //bodyView.btnCurtainStop.IsSelected = false;
                         bodyView.btnCurtainBgIcon.IsSelected = false;
                     }
                 }
@@ -72,34 +72,40 @@
         void LoadEvent_ControlEvent()
         {
             btnCurtainClose.MouseUpEventHandler = (sender, e) => {
-                btnCurtainClose.IsSelected = true;
-                btnCurtainStop.IsSelected = false;
-                btnCurtainOpen.IsSelected = false;
+                new System.Threading.Thread(() => {
+                    System.Threading.Thread.Sleep(2000);
+                    Application.RunOnMainThread(() => {
+                        btnCurtainClose.IsSelected = false;
+                    });
+                }) { IsBackground = true }.Start();
                 btnCurtainBgIcon.IsSelected = false;
                 curtain.trait_on_off.curValue = "off";
-                //Control.Send(CommandType_A.write,curtain);
                 System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                 d.Add("on_off", curtain.trait_on_off.curValue.ToString());
                 Control.Ins.SendWriteCommand(curtain, d);
             };
 
-            //btnCurtainStop.MouseDownEventHandler = (sender, e) =>
-            //{
-            //    btnCurtainStop.IsSelected = true;
-            //    //btnCurtainClose.IsSelected = false;
-            //    //btnCurtainOpen.IsSelected = false;
-            //};
-            //btnCurtainOpen.MouseDownEventHandler = (sender, e) => {
-            //    btnCurtainOpen.IsSelected = true;
-            //};
-            //btnCurtainClose.MouseDownEventHandler = (sender, e) => {
-            //    btnCurtainClose.IsSelected = true;
-            //};
+            btnCurtainStop.MouseDownEventHandler = (sender, e) =>
+            {
+                btnCurtainStop.IsSelected = true;
+            };
+            btnCurtainOpen.MouseDownEventHandler = (sender, e) =>
+            {
+                btnCurtainOpen.IsSelected = true;
+            };
+            btnCurtainClose.MouseDownEventHandler = (sender, e) =>
+            {
+                btnCurtainClose.IsSelected = true;
+            };
             btnCurtainStop.MouseUpEventHandler = (sender, e) =>
             {
-                btnCurtainOpen.IsSelected = false;
-                btnCurtainClose.IsSelected = false;
-                btnCurtainStop.IsSelected = true;
+                new System.Threading.Thread(() => {
+                    System.Threading.Thread.Sleep(2000);
+                    Application.RunOnMainThread(() => {
+                        btnCurtainStop.IsSelected = false;
+                    });
+                })
+                { IsBackground = true }.Start();
                 curtain.trait_on_off.curValue = "stop";
                 System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                 d.Add("on_off", curtain.trait_on_off.curValue.ToString());
@@ -107,9 +113,13 @@
             };
             btnCurtainOpen.MouseUpEventHandler = (sender, e) =>
             {
-                btnCurtainOpen.IsSelected = true;
-                btnCurtainClose.IsSelected = false;
-                btnCurtainStop.IsSelected = false;
+                new System.Threading.Thread(() => {
+                    System.Threading.Thread.Sleep(2000);
+                    Application.RunOnMainThread(() => {
+                        btnCurtainOpen.IsSelected = false;
+                    });
+                })
+                { IsBackground = true }.Start();
                 btnCurtainBgIcon.IsSelected = true;
                 curtain.trait_on_off.curValue = "on";
                 System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();

--
Gitblit v1.8.0