| | |
| | | (s,c)=>{ |
| | | try |
| | | { |
| | | var page = new AddGroupControlPage(new System.Collections.Generic.List<Function>(),new GroupControl(), |
| | | var page = new AddGroupControlPage(null, |
| | | ()=> { |
| | | |
| | | }); |
| | |
| | | try |
| | | { |
| | | var groupControlList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); |
| | | LoadGroupControlView(groupControlList); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | LoadGroupControlView(groupControlList); |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | |
| | | }) { IsBackground = true }.Start(); |
| | | |
| | | #region |
| | |
| | | |
| | | 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) |
| | | { |
| | | |
| | | } |
| | |
| | | { |
| | | contentView.RemoveAll(); |
| | | |
| | | foreach (var function in list) |
| | | foreach (var groupControl in list) |
| | | { |
| | | var functionRow = new FrameLayout() |
| | | { |
| | |
| | | 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() |
| | | { |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = function.name, |
| | | Text = groupControl.name, |
| | | }; |
| | | functionRow.AddChidren(btnFunctionName); |
| | | |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Text = function.GetRoomListName(), |
| | | Text = groupControl.GetRoomListName(), |
| | | }; |
| | | functionRow.AddChidren(btnFunctionLocationInfo); |
| | | |
| | |
| | | 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; |
| | | |
| | | } |
| | | |
| | | } |