From 9c607e921ca7c379799e4dd88b140265a1d5d5c5 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 22 十一月 2019 16:35:30 +0800
Subject: [PATCH] 需要合并
---
ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs | 38 ++++++++++++++++++++++++++------------
1 files changed, 26 insertions(+), 12 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
old mode 100755
new mode 100644
index 946630a..4c19d06
--- a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
@@ -145,7 +145,30 @@
}
else if (typeTag == "OnlineStatusChange")
{
-
+ Application.RunOnMainThread(() =>
+ {
+ try
+ {
+ var deviceUI = device;
+ //璁惧涓虹┖
+ if (deviceUI.CommonDevice == null)
+ {
+ return;
+ }
+ //鏄惁涓哄綋鍓嶈澶�
+ if (deviceUI.CommonDevice.DeviceEpoint != common.DeviceEpoint || deviceUI.CommonDevice.DeviceAddr != common.DeviceAddr)
+ {
+ return;
+ }
+ deviceUI.CommonDevice.IsOnline = common.IsOnline;
+ deviceIMG.IsSelected = switchBtn.IsSelected = deviceUI.CommonDevice.IsOnline == 1;
+ deviceUI.CommonDevice.LastDateTime = DateTime.Now;
+ }
+ catch (Exception ex)
+ {
+ System.Console.WriteLine($"Error:{ex.Message}");
+ }
+ });
}
}
#endregion
@@ -157,8 +180,8 @@
public override void RemoveFromParent()
{
ZbGateway.StatusList.Remove(this);
- action();
- action = null;
+ //action();
+ //action = null;
RemoveUpdateControlDeviceStatuAction();
base.RemoveFromParent();
}
@@ -243,15 +266,6 @@
RemoveFromParent();
};
- var sharedBtn = new Button
- {
- X = Application.GetRealWidth(850),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/Shared.png"
- };
- top.topView.AddChidren(sharedBtn);
var moreBtn = new Button
{
--
Gitblit v1.8.0