From 1f5fdd892e8efc9f1babe1ace9d810803edef396 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期五, 27 八月 2021 11:29:45 +0800 Subject: [PATCH] 2021-08-27 11:29:39 --- HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs | 43 ++++++++++++++++++++++++++++++------------- 1 files changed, 30 insertions(+), 13 deletions(-) diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs index 4a678e3..52ba900 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs @@ -30,21 +30,38 @@ /// </summary> public static void LoadEvent_RefreshSecurityStatus() { - Application.RunOnMainThread(() => + try { - if (bodyView != null) + Application.RunOnMainThread(() => { - //foreach(var temp in FunctionList.List.securities) - //{ - // if(temp.status == "enable") - // { - // bodyView.btnSecurityStatus.IsSelected = true; - // return; - // } - //} - bodyView.btnSecurityStatus.IsSelected = SecurityCenter.Ins.InDefense; - } - }); + if (bodyView != null) + { + lock (FunctionList.List.securities) + { + foreach (var temp in FunctionList.List.securities) + { + if (temp.status == "enable") + { + if (temp.alarm) + { + bodyView.btnSecurityStatus.SelectedImagePath = "Collection/DefenseAlarmIcon.png"; + } + else + { + bodyView.btnSecurityStatus.SelectedImagePath = "Collection/DefenseStatusIcon.png"; + } + bodyView.btnSecurityStatus.IsSelected = true; + return; + } + } + } + } + }); + } + catch (Exception ex) + { + MainPage.Log($"瀹夐槻涓婚〉鏇存柊寮傚父锛歿ex.Message}"); + } } /// <summary> -- Gitblit v1.8.0