| | |
| | | /// <summary> |
| | | /// 显示的设备的总数 |
| | | /// </summary> |
| | | int showCount = 0; |
| | | int showCount = -1; |
| | | |
| | | /// <summary> |
| | | /// 加载功能row |
| | |
| | | { |
| | | if (!isAppend) |
| | | { |
| | | showCount = 0; |
| | | showCount = -1; |
| | | functionListView.RemoveAll(); |
| | | } |
| | | int i = 0; |
| | | foreach (var function in functions) |
| | | for(var i =0;i<100;i++) |
| | | //foreach (var function in functions) |
| | | { |
| | | i++; |
| | | if (i > 100) |
| | | showCount++; |
| | | if (showCount >= functions.Count) |
| | | { |
| | | break; |
| | | } |
| | | showCount++; |
| | | var function = functions[showCount]; |
| | | |
| | | var functionDiv = new LightRow(function) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = "加载更多", |
| | | TextID = StringId.LoadMore, |
| | | }; |
| | | if (Language.CurrentLanguage != "Chinese") |
| | | { |
| | | btnAppend.Text = "Load more"; |
| | | } |
| | | functionListView.AddChidren(btnAppend); |
| | | btnAppend.MouseUpEventHandler = (sender, e) => |
| | | { |
| | |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Light/LightScene/CheckIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Light/LightScene/CheckOnIcon.png", |
| | | IsSelected = functions.Find((obj) => obj.deviceId == function.deviceId) != null |
| | | IsSelected = functions.Find((obj) => obj.deviceId == function.deviceId) != null, |
| | | Tag = "ChooseIcon" |
| | | }; |
| | | if (DB_ResidenceData.Instance.CurrentRegion.isSupportGroupControl) |
| | | if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl) |
| | | { |
| | | btnSelect.X = Application.GetRealWidth(323); |
| | | } |
| | | bodyDiv.AddChidren(btnSelect); |
| | | |
| | | btnSelect.MouseUpEventHandler = (sender, e) => { |
| | | Application.HideSoftInput(); |
| | | btnSelect.IsSelected = !btnSelect.IsSelected; |
| | | if(btnSelect.IsSelected) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | var removeTemp = functions.Find((obj) => obj.deviceId == function.deviceId); |
| | | var removeTemp = functions.Find((obj) => obj.sid == function.sid); |
| | | if (removeTemp != null) |
| | | { |
| | | functions.Remove(removeTemp); |
| | | } |
| | | } |
| | | ///刷新界面 |
| | | if (functions.Count == 0 || functions.Count == 1) |
| | | { |
| | | //if (functions.Count == 0 || functions.Count == 1) |
| | | //{ |
| | | action(); |
| | | } |
| | | //} |
| | | }; |
| | | |
| | | } |