From 60c59ea2ed4ee11a9989fdd4ce0ddace6efe452e Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 04 四月 2023 14:35:46 +0800 Subject: [PATCH] 群控备份 --- HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs | 64 ++++++++++++++++++++++++++++--- 1 files changed, 57 insertions(+), 7 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs index 770551c..5805d72 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs @@ -24,7 +24,7 @@ (s,c)=>{ try { - var page = new AddGroupControlPage(new System.Collections.Generic.List<Function>(),new GroupControl(), + var page = new AddGroupControlPage(null, ()=> { }); @@ -54,7 +54,10 @@ try { var groupControlList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); - LoadGroupControlView(groupControlList); + Application.RunOnMainThread(() => + { + LoadGroupControlView(groupControlList); + }); } catch (Exception ex) { @@ -66,7 +69,6 @@ IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); } } - }) { IsBackground = true }.Start(); #region @@ -81,7 +83,31 @@ private void LoadGroupControlView(List<GroupControl> list) { - if(list.Count == 0) +#if DEBUG + if (list.Count == 0) + { + list.Add(new GroupControl() + { + name = "缁勫悎璋冨厜1", + roomIds = new List<string> { Room.CurrentSpatial.RoomList[0].roomId }, + sid = "00000000000000001", + type = "light", + uids = new List<string>() { Room.CurrentSpatial.RoomList[0].uid }, + }); + + list.Add(new GroupControl() + { + name = "缁勫悎璋冨厜2", + roomIds = new List<string> { Room.CurrentSpatial.RoomList[0].roomId }, + sid = "00000000000000002", + type = "light", + uids = new List<string>() { Room.CurrentSpatial.RoomList[0].uid }, + }); + } + +#endif + + if (list.Count == 0) { } @@ -89,7 +115,7 @@ { contentView.RemoveAll(); - foreach (var function in list) + foreach (var groupControl in list) { var functionRow = new FrameLayout() { @@ -97,6 +123,16 @@ BackgroundColor = CSS_Color.MainBackgroundColor, }; contentView.AddChidren(functionRow); + + var btnRight = new Button() + { + X = Application.GetRealWidth(339), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/Right.png", + }; + functionRow.AddChidren(btnRight); var btnFunctionName = new Button() { @@ -107,7 +143,7 @@ TextAlignment = TextAlignment.CenterLeft, TextSize = CSS_FontSize.SubheadingFontSize, TextColor = CSS_Color.FirstLevelTitleColor, - Text = function.name, + Text = groupControl.name, }; functionRow.AddChidren(btnFunctionName); @@ -120,7 +156,7 @@ TextAlignment = TextAlignment.CenterLeft, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextColor = CSS_Color.PromptingColor1, - Text = function.GetRoomListName(), + Text = groupControl.GetRoomListName(), }; functionRow.AddChidren(btnFunctionLocationInfo); @@ -136,6 +172,20 @@ BackgroundColor = CSS_Color.DividingLineColor, }); + EventHandler<MouseEventArgs> eventHandler = (sender, e) => { + var page = new AddGroupControlPage(groupControl, + () => { + + }); + MainPage.BasePageView.AddChidren(page); + page.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + functionRow.MouseUpEventHandler = eventHandler; + btnRight.MouseUpEventHandler = eventHandler; + btnFunctionName.MouseUpEventHandler = eventHandler; + btnFunctionLocationInfo.MouseUpEventHandler = eventHandler; + } } -- Gitblit v1.8.0