| | |
| | | /// <summary> |
| | | /// 当前窗体 |
| | | /// </summary> |
| | | static FrameLayout bodyView; |
| | | public static FunctionPage bodyView; |
| | | /// <summary> |
| | | /// 楼层选择下拉图标 |
| | | /// </summary> |
| | |
| | | #endregion |
| | | |
| | | List<Function> functionList; |
| | | int titleId; |
| | | |
| | | public FunctionPage() |
| | | { |
| | | bodyView = this; |
| | | functionList = new List<Function>(); |
| | | |
| | | } |
| | | |
| | | public void LoadPage(int titleId) |
| | | /// <summary> |
| | | /// 重载界面 |
| | | /// </summary> |
| | | public void ReLoadPage() |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | try |
| | | { |
| | | bodyView.RemoveAll(); |
| | | LoadPage(this.titleId); |
| | | functionList = new List<Function>(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"FunctionPage ReloadPage error :\r\n {ex.Message}"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void LoadPage(int titleId_out) |
| | | { |
| | | this.titleId = titleId_out; |
| | | |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | if (titleId == StringId.Lights && !DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl) |
| | |
| | | |
| | | if (titleId == StringId.Lights) |
| | | { |
| | | functionList.AddRange(FunctionList.List.groupControls); |
| | | //functionList.AddRange(FunctionList.List.groupControls); |
| | | functionList.AddRange(FunctionList.List.GetLightList()); |
| | | |
| | | |
| | | var lightScene = FunctionList.List.scenes.FindAll((obj) => obj.sceneType == SceneType.LightScene); |
| | | |
| | | foreach (var scene in lightScene) |
| | | { |
| | | functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); |
| | | |
| | | var sceneRow = new SceneControlZone(scene); |
| | | functionListView.AddChidren(sceneRow); |
| | | sceneRow.LoadView(); |
| | | } |
| | | |
| | | } |
| | | else if(titleId == StringId.HorseRaceLamp) |
| | | { |
| | | functionList.AddRange(FunctionList.List.GetSeries()); |
| | | } |
| | | else if (titleId == StringId.AC) |
| | | { |
| | |
| | | { |
| | | functionList.AddRange(FunctionList.List.GetAirFreshList()); |
| | | } |
| | | else if(titleId == StringId.MechanicalArm) |
| | | else if (titleId == StringId.MechanicalArm) |
| | | { |
| | | functionList.AddRange(FunctionList.List.GetMechanicalArmList()); |
| | | } |
| | | else if(titleId == StringId.SecurityMonitoring) |
| | | else if (titleId == StringId.SecurityMonitoring) |
| | | { |
| | | functionList.AddRange(FunctionList.List.GetIpCamImouList()); |
| | | } |
| | |
| | | LoadDialog_ChangeFloor(); |
| | | |
| | | |
| | | #region 加载组合调光场景 |
| | | if (titleId == StringId.Lights) |
| | | { |
| | | foreach (var lightScene in FunctionList.List.scenes) |
| | | { |
| | | if (lightScene.sceneType == SceneType.LightScene) |
| | | if (lightScene != null) |
| | | { |
| | | functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); |
| | | var sceneRow = new SceneControlZone(lightScene); |
| | | functionListView.AddChidren(sceneRow); |
| | | sceneRow.LoadView(); |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | |
| | | { |
| | | showCount = -1; |
| | | functionListView.RemoveAll(); |
| | | #region 加载组合调光场景 |
| | | if (titleId == StringId.Lights) |
| | | { |
| | | foreach (var lightScene in FunctionList.List.scenes) |
| | | { |
| | | if (lightScene.sceneType == SceneType.LightScene) |
| | | if (lightScene != null) |
| | | { |
| | | var sceneRow = new SceneControlZone(lightScene); |
| | | functionListView.AddChidren(sceneRow); |
| | | sceneRow.LoadView(); |
| | | functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | for(var i = 0;i<50;i++) |
| | | for (var i = 0;i<50;i++) |
| | | //foreach (var function in showList) |
| | | { |
| | | showCount++; |