From cda2410f9c29f2fadc16e9de38ccae95b75a89dd Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 09 六月 2021 10:51:13 +0800
Subject: [PATCH] 1

---
 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs |  542 +++++++++++++++++++++++++++++------------------------
 1 files changed, 298 insertions(+), 244 deletions(-)

diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
index f333a9b..2f3552a 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -76,6 +76,7 @@
 
         public void LoadPage()
         {
+            MainPage.CurPageIndex = 1;
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
             #region top
             FrameLayout topView = new FrameLayout()
@@ -373,7 +374,14 @@
                         roomView.RemoveFromParent();
                     };
 
-                    var view = new RoomPage(room, ReloadRoomName, deleteAction);
+                    //鎴块棿鑳屾櫙鍥句慨鏀逛簨浠跺洖璋�
+                    Action modifyImageAction = () =>
+                    {
+                        //roomViewbg.ImagePath = room.backgroundImage;
+                        ImageUtlis.Current.LoadLocalOrNetworkImages(room.backgroundImage, roomViewbg);
+                    };
+
+                    var view = new RoomPage(room, ReloadRoomName, deleteAction, modifyImageAction);
                     MainPage.BasePageView.AddChidren(view);
                     view.LoadPage();
                     MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
@@ -423,6 +431,7 @@
 
             var lastY1 = Application.GetRealWidth(16);
             var lastY2 = Application.GetRealWidth(16);
+            var functionContentViewHeight = Application.GetRealWidth(16);
 
             var functionCategoryCount = 0;
 
@@ -434,85 +443,88 @@
                 {
                     case ShowFunction.Light:
                         #region Light
-                        functionCount = FunctionList.List.lights.Count;
-                        functionOnCount = FunctionList.List.lights.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+                        functionCount = FunctionList.List.GetLightList().Count;
+                        functionOnCount = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         #endregion
                         break;
                     case ShowFunction.AC:
                         #region AC
-                        functionCount = FunctionList.List.aCs.Count;
-                        functionOnCount = FunctionList.List.aCs.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+                        functionCount = FunctionList.List.GetAcList().Count;
+                        functionOnCount = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         #endregion
                         break;
                     case ShowFunction.Curtain:
                         #region Curtain
-                        functionCount = FunctionList.List.curtains.Count;
-                        functionOnCount = FunctionList.List.curtains.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+                        functionCount = FunctionList.List.GetCurtainList().Count;
+                        functionOnCount = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         #endregion
                         break;
                     case ShowFunction.FloorHeating:
                         #region 鍦扮儹
-                        functionCount = FunctionList.List.floorHeatings.Count;
-                        functionOnCount = FunctionList.List.floorHeatings.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+                        functionCount = FunctionList.List.GetFloorHeatingList().Count;
+                        functionOnCount = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         #endregion
                         break;
                     case ShowFunction.DoorLock:
                         break;
                     case ShowFunction.Electric:
                         #region 鐢靛櫒
-                        functionCount = FunctionList.List.electricals.Count;
-                        functionOnCount = FunctionList.List.electricals.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+                        functionCount = FunctionList.List.GetElectricals().Count;
+                        functionOnCount = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                         #endregion
                         break;
                     case ShowFunction.EnergyMonitoring:
+                        #region 鑳芥簮
+                        functionCount = FunctionList.List.GetEnergyList().Count;
+                        functionOnCount = FunctionList.List.GetEnergyList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+                        #endregion
                         break;
                     case ShowFunction.Environmental:
                         #region 鐜鏁版嵁
-                        functionCount = FunctionList.List.sensorsEnvironmentalScience.Count;
+                        functionCount = FunctionList.List.GetEnvirSensorsList().Count;
                         #endregion
                         break;
                     case ShowFunction.FreshAir:
+                        functionCount = FunctionList.List.GetAirFreshList().Count;
                         break;
                     case ShowFunction.Music:
                         functionCount = Music.A31MusicModel.A31MusicModelList.Count;
                         functionOnCount = Music.A31MusicModel.A31MusicModelList.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
+                        if(functionCount == 0)
+                        {
+                            functionCount = FunctionList.List.GetMusicList().Count;
+                        }
                         break;
                     case ShowFunction.Panel:
                         break;
                     case ShowFunction.SecurityMonitoring:
+                        functionCount = 1;
                         break;
                     case ShowFunction.Sensor:
+                        functionCount = FunctionList.List.GetArmSensorList().Count;
                         break;
                     case ShowFunction.VideoIntercom:
+                        if (FunctionList.List.videoIntercom != null)
+                        {
+                            functionCount = 1;
+                        }
+                        break;
+                    case ShowFunction.SecurityCenter:
+                        functionCount = FunctionList.List.securities.Count;
+#if DEBUG
+                        functionCount = 1;
+#endif
                         break;
 
                 }
 
-                if (functionCount == 0 && item != ShowFunction.Music)
+                if(functionCount == 0)
                 {
                     continue;
                 }
+
                 functionCategoryCount++;
 
-                //FunctionType ft = FunctionType.A31Music
-                //switch (item)
-                //{
-                //    case FunctionType.FloorHeating:
-                //        break;
-                //    case FunctionType.AC:
-                //        break;
-                //    case FunctionType.MotorCurtain:
-                //    case FunctionType.Curtain:
-                //    case FunctionType.RollingShutter:
-                //        break;
-                //    case FunctionType.Relay:
-                //    case FunctionType.Dimmer:
-                //    case FunctionType.RGB:
-                //    case FunctionType.ColorTemperature:
-                //        break;
-                //    case FunctionType.Socket:
-                //        break;
-                //}
                 FrameLayout functionView = new FrameLayout()
                 {
                     Height = Application.GetRealWidth(161),
@@ -543,226 +555,26 @@
                 {
                     s2View.AddChidren(functionView);
                 }
+                functionContentViewHeight = functionView.Bottom;
 
 
                 Button btnName = new Button()
                 {
                     X = Application.GetRealWidth(16),
                     Y = Application.GetRealHeight(14),
-                    Width = Application.GetRealWidth(120),
+                    Width = Application.GetRealWidth(140),
                     Height = Application.GetRealHeight(24),
                     TextColor = CSS_Color.FirstLevelTitleColor,
                     TextSize = CSS_FontSize.TextFontSize,
                     TextAlignment = TextAlignment.CenterLeft,
+                    IsMoreLines = true,
                 };
                 functionView.AddChidren(btnName);
 
-
-                Button btnFunctionViewBg;
-                btnFunctionViewBg = new Button()
-                {
-                    Height = Application.GetRealWidth(161),
-                    UnSelectedImagePath = "FunctionIcon/FunctionBg/" + item + "FunctionBg.png",
-                };
-                functionView.AddChidren(btnFunctionViewBg);
-
-                int functionPageTitleId = 0;
-                switch (item)
-                {
-                    case ShowFunction.Light:
-                        #region Light
-                        btnName.TextID = StringId.Lights;
-                        functionCount = FunctionList.List.lights.Count;
-                        functionOnCount = FunctionList.List.lights.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
-                        Button btnLightPower = new Button()
-                        {
-                            X = Application.GetRealWidth(120),
-                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
-                            Width = Application.GetRealWidth(32),
-                            Height = Application.GetRealWidth(32),
-                            SelectedImagePath = "Public/PowerOpen.png",
-                            UnSelectedImagePath = "Public/PowerClose.png",
-                            IsSelected = functionOnCount > 0,
-                            Tag = item + "_AllControl",
-                        };
-                        functionView.AddChidren(btnLightPower);
-
-                        btnLightPower.MouseUpEventHandler = (sender, e) =>
-                        {
-                            LoadEvent_SwitchFunction(btnLightPower, item);
-                        };
-                        functionPageTitleId = StringId.Lights;
-                      
-                        #endregion
-                        break;
-                    case ShowFunction.AC:
-                        #region AC
-                        btnName.TextID = StringId.AC;
-                        functionCount = FunctionList.List.aCs.Count;
-                        functionOnCount = FunctionList.List.aCs.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
-                        Button btnAcPower = new Button()
-                        {
-                            X = Application.GetRealWidth(120),
-                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
-                            Width = Application.GetRealWidth(32),
-                            Height = Application.GetRealWidth(32),
-                            SelectedImagePath = "Public/PowerOpen.png",
-                            UnSelectedImagePath = "Public/PowerClose.png",
-                            Tag = item + "_AllControl",
-                            IsSelected = functionOnCount > 0,
-                        };
-                        functionView.AddChidren(btnAcPower);
-                        btnAcPower.MouseUpEventHandler = (sender, e) =>
-                        {
-                            LoadEvent_SwitchFunction(btnAcPower, item);
-                        };
-                        functionPageTitleId = StringId.AC;
-                        #endregion
-                        break;
-                    case ShowFunction.Curtain:
-                        #region Curtain
-                        btnName.TextID = StringId.Curtain;
-                        functionCount = FunctionList.List.curtains.Count;
-                        functionOnCount = FunctionList.List.curtains.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
-                        Button btnClose;
-                        btnClose = new Button()
-                        {
-                            X = Application.GetRealWidth(72),
-                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
-                            Width = Application.GetRealWidth(32),
-                            Height = Application.GetRealWidth(32),
-                            UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png",
-                            SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png",
-                            //Tag = item + "_AllControl",
-                            IsSelected = !DB_ResidenceData.Instance.GlobalCurtainStatus,
-                        };
-                        functionView.AddChidren(btnClose);
-
-                        Button btnOpen;
-                        btnOpen = new Button()
-                        {
-                            X = Application.GetRealWidth(120),
-                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
-                            Width = Application.GetRealWidth(32),
-                            Height = Application.GetRealWidth(32),
-                            UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png",
-                            SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png",
-                            IsSelected = DB_ResidenceData.Instance.GlobalCurtainStatus,
-                        };
-                        functionView.AddChidren(btnOpen);
-                        LoadEvent_CurtainSwitch(btnClose, btnOpen);
-
-                        functionPageTitleId = StringId.Curtain;
-                        #endregion
-                        break;
-                    case ShowFunction.FloorHeating:
-                        #region 鍦扮儹
-                        btnName.TextID = StringId.FloorHeating;
-                        functionCount = FunctionList.List.floorHeatings.Count;
-                        functionOnCount = FunctionList.List.floorHeatings.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
-                        Button btnFhPower = new Button()
-                        {
-                            X = Application.GetRealWidth(120),
-                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
-                            Width = Application.GetRealWidth(32),
-                            Height = Application.GetRealWidth(32),
-                            SelectedImagePath = "Public/PowerOpen.png",
-                            UnSelectedImagePath = "Public/PowerClose.png",
-                            Tag = item + "_AllControl",
-                            IsSelected = functionOnCount > 0
-                        };
-                        functionView.AddChidren(btnFhPower);
-                        btnFhPower.MouseUpEventHandler = (sender, e) =>
-                        {
-                            LoadEvent_SwitchFunction(btnFhPower, item);
-                        };
-                        functionPageTitleId = StringId.FloorHeating;
-                        #endregion
-                        break;
-                    case ShowFunction.DoorLock:
-                        btnName.TextID = StringId.DoorLock;
-                        break;
-                    case ShowFunction.Electric:
-                        #region 鐢靛櫒
-                        btnName.TextID = StringId.Electric;
-                        functionCount = FunctionList.List.electricals.Count;
-                        functionOnCount = FunctionList.List.electricals.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
-                        Button btnElectricPower = new Button()
-                        {
-                            X = Application.GetRealWidth(120),
-                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
-                            Width = Application.GetRealWidth(32),
-                            Height = Application.GetRealWidth(32),
-                            SelectedImagePath = "Public/PowerOpen.png",
-                            UnSelectedImagePath = "Public/PowerClose.png",
-                            Tag = item + "_AllControl",
-                            IsSelected = functionOnCount > 0,
-                        };
-                        functionView.AddChidren(btnElectricPower);
-                        btnElectricPower.MouseUpEventHandler = (sender, e) =>
-                        {
-                            LoadEvent_SwitchFunction(btnElectricPower, item);
-                        };
-                        functionPageTitleId = StringId.Electric;
-                        #endregion
-                        break;
-                    case ShowFunction.EnergyMonitoring:
-                        btnName.TextID = StringId.EnergyMonitoring;
-                        break;
-                    case ShowFunction.Environmental:
-                        #region 鐜鏁版嵁
-                        btnName.TextID = StringId.EnvironmentalData;
-                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
-                        {
-                            var skipView = new EnvironmentalSciencePage();
-                            MainPage.BasePageView.AddChidren(skipView);
-                            skipView.LoadPage();
-                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-                        };
-                        #endregion
-                        break;
-                    case ShowFunction.FreshAir:
-                        btnName.TextID = StringId.FreshAir;
-                        break;
-                    case ShowFunction.Music:
-                        btnName.TextID = StringId.Music;
-                        functionCount = Music.A31MusicModel.A31MusicModelList.Count;
-                        functionOnCount = Music.A31MusicModel.A31MusicModelList.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
-                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
-                        {
-                            var musicMain = new Music.MusicMain();
-                            MainPage.BasePageView.AddChidren(musicMain);
-                            musicMain.Show();
-                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-                        };
-                        break;
-                    case ShowFunction.Panel:
-                        btnName.TextID = StringId.Panel;
-                        break;
-                    case ShowFunction.SecurityMonitoring:
-                        btnName.TextID = StringId.SecurityMonitoring;
-                        break;
-                    case ShowFunction.Sensor:
-                        btnName.TextID = StringId.Sensor;
-
-                        break;
-                    case ShowFunction.VideoIntercom:
-                        btnName.TextID = StringId.VideoIntercom;
-                        break;
-
-                }
-                //鐣岄潰璺宠浆--闊充箰璺宠浆鑷繁鐨勭晫闈�--鐜璺宠浆鑷繁鐨勭晫闈�
-                if (item != ShowFunction.Music && item != ShowFunction.Environmental)
-                {
-                    btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
-                    {
-                        var skipView = new FunctionPage();
-                        MainPage.BasePageView.AddChidren(skipView);
-                        skipView.LoadPage(functionPageTitleId);
-                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-                    };
-                }
-                if (item != ShowFunction.Environmental && functionCount != 0)
+                if (item != ShowFunction.Environmental && item != ShowFunction.Sensor && item != ShowFunction.VideoIntercom
+                    && item != ShowFunction.SecurityMonitoring && item != ShowFunction.FreshAir
+                    && item != ShowFunction.EnergyMonitoring && item != ShowFunction.SecurityCenter
+                    && functionCount != 0)
                 {
                     Button btnFunctionCount = new Button()
                     {
@@ -791,16 +603,258 @@
                     };
                     functionView.AddChidren(btnOpenCount);
                 }
+
+
+                Button btnFunctionViewBg;
+                btnFunctionViewBg = new Button()
+                {
+                    Height = Application.GetRealWidth(161),
+                    UnSelectedImagePath = "FunctionIcon/FunctionBg/" + item + "FunctionBg.png",
+                };
+                functionView.AddChidren(btnFunctionViewBg);
+
+                int functionPageTitleId = 0;
+                switch (item)
+                {
+                    case ShowFunction.Light:
+                        #region Light
+                        btnName.TextID = StringId.Lights;
+                        Button btnLightPower = new Button()
+                        {
+                            X = Application.GetRealWidth(120),
+                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
+                            Width = Application.GetRealWidth(32),
+                            Height = Application.GetRealWidth(32),
+                            SelectedImagePath = "Public/PowerOpen.png",
+                            UnSelectedImagePath = "Public/PowerClose.png",
+                            IsSelected = functionOnCount > 0,
+                            Tag = item + "_AllControl",
+                        };
+                        functionView.AddChidren(btnLightPower);
+
+                        btnLightPower.MouseUpEventHandler = (sender, e) =>
+                        {
+                            LoadEvent_SwitchFunction(btnLightPower, item, functionView);
+                        };
+                        functionPageTitleId = StringId.Lights;
+
+                        #endregion
+                        break;
+                    case ShowFunction.AC:
+                        #region AC
+                        btnName.TextID = StringId.AC;
+                        Button btnAcPower = new Button()
+                        {
+                            X = Application.GetRealWidth(120),
+                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
+                            Width = Application.GetRealWidth(32),
+                            Height = Application.GetRealWidth(32),
+                            SelectedImagePath = "Public/PowerOpen.png",
+                            UnSelectedImagePath = "Public/PowerClose.png",
+                            Tag = item + "_AllControl",
+                            IsSelected = functionOnCount > 0,
+                        };
+                        functionView.AddChidren(btnAcPower);
+                        btnAcPower.MouseUpEventHandler = (sender, e) =>
+                        {
+                            LoadEvent_SwitchFunction(btnAcPower, item, functionView);
+                        };
+                        functionPageTitleId = StringId.AC;
+                        #endregion
+                        break;
+                    case ShowFunction.Curtain:
+                        #region Curtain
+                        btnName.TextID = StringId.Curtain;
+                        Button btnClose;
+                        btnClose = new Button()
+                        {
+                            X = Application.GetRealWidth(72),
+                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
+                            Width = Application.GetRealWidth(32),
+                            Height = Application.GetRealWidth(32),
+                            UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png",
+                            SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png",
+                            IsSelected = !DB_ResidenceData.Instance.GlobalCurtainStatus,
+                        };
+                        functionView.AddChidren(btnClose);
+
+                        Button btnOpen;
+                        btnOpen = new Button()
+                        {
+                            X = Application.GetRealWidth(120),
+                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
+                            Width = Application.GetRealWidth(32),
+                            Height = Application.GetRealWidth(32),
+                            UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png",
+                            SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png",
+                            IsSelected = DB_ResidenceData.Instance.GlobalCurtainStatus,
+                        };
+                        functionView.AddChidren(btnOpen);
+                        LoadEvent_CurtainSwitch(btnClose, btnOpen, functionView);
+
+                        functionPageTitleId = StringId.Curtain;
+                        #endregion
+                        break;
+                    case ShowFunction.FloorHeating:
+                        #region 鍦扮儹
+                        btnName.TextID = StringId.FloorHeating;
+                        Button btnFhPower = new Button()
+                        {
+                            X = Application.GetRealWidth(120),
+                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
+                            Width = Application.GetRealWidth(32),
+                            Height = Application.GetRealWidth(32),
+                            SelectedImagePath = "Public/PowerOpen.png",
+                            UnSelectedImagePath = "Public/PowerClose.png",
+                            Tag = item + "_AllControl",
+                            IsSelected = functionOnCount > 0
+                        };
+                        functionView.AddChidren(btnFhPower);
+                        btnFhPower.MouseUpEventHandler = (sender, e) =>
+                        {
+                            LoadEvent_SwitchFunction(btnFhPower, item, functionView);
+                        };
+                        functionPageTitleId = StringId.FloorHeating;
+                        #endregion
+                        break;
+                    case ShowFunction.DoorLock:
+                        btnName.TextID = StringId.DoorLock;
+                        break;
+                    case ShowFunction.Electric:
+                        #region 鐢靛櫒
+                        btnName.TextID = StringId.Electric;
+                        Button btnElectricPower = new Button()
+                        {
+                            X = Application.GetRealWidth(120),
+                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
+                            Width = Application.GetRealWidth(32),
+                            Height = Application.GetRealWidth(32),
+                            SelectedImagePath = "Public/PowerOpen.png",
+                            UnSelectedImagePath = "Public/PowerClose.png",
+                            Tag = item + "_AllControl",
+                            IsSelected = functionOnCount > 0,
+                        };
+                        functionView.AddChidren(btnElectricPower);
+                        btnElectricPower.MouseUpEventHandler = (sender, e) =>
+                        {
+                            LoadEvent_SwitchFunction(btnElectricPower, item, functionView);
+                        };
+                        functionPageTitleId = StringId.Electric;
+                        #endregion
+                        break;
+                    case ShowFunction.EnergyMonitoring:
+                        #region 鑳芥簮鐩戞祴
+                        btnName.TextID = StringId.EnergyMonitoring;
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+                            var skipView = new EnergyMainPage();
+                            MainPage.BasePageView.AddChidren(skipView);
+                            skipView.LoadPage();
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        };
+                        #endregion
+                        break;
+                    case ShowFunction.Environmental:
+                        #region 鐜鏁版嵁
+                        btnName.TextID = StringId.EnvironmentalData;
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+                        {
+                            var skipView = new EnvironmentalPage();// EnvironmentalSciencePage();
+                            MainPage.BasePageView.AddChidren(skipView);
+                            skipView.LoadPage();
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        };
+                        #endregion
+                        break;
+                    case ShowFunction.FreshAir:
+                        btnName.TextID = StringId.FreshAir;
+                        #region Light
+                        Button btnFreshAirPower = new Button()
+                        {
+                            X = Application.GetRealWidth(120),
+                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
+                            Width = Application.GetRealWidth(32),
+                            Height = Application.GetRealWidth(32),
+                            SelectedImagePath = "Public/PowerOpen.png",
+                            UnSelectedImagePath = "Public/PowerClose.png",
+                            IsSelected = functionOnCount > 0,
+                            Tag = item + "_AllControl",
+                        };
+                        functionView.AddChidren(btnFreshAirPower);
+
+                        btnFreshAirPower.MouseUpEventHandler = (sender, e) =>
+                        {
+                            LoadEvent_SwitchFunction(btnFreshAirPower, item, functionView);
+                        };
+                        functionPageTitleId = StringId.FreshAir;
+
+                        #endregion
+                        break;
+                    case ShowFunction.Music:
+                        btnName.TextID = StringId.Music;
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+                        {
+                            var musicMain = new Music.MusicMain();
+                            MainPage.BasePageView.AddChidren(musicMain);
+                            musicMain.Show();
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        };
+                        break;
+                    case ShowFunction.Panel:
+                        btnName.TextID = StringId.Panel;
+                        break;
+                    case ShowFunction.SecurityMonitoring:
+                        btnName.TextID = StringId.SecurityMonitoring;
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+                        {
+                            HDLCommon.Current.Go2EZvizMonitor(bodyView);
+                        };
+                        break;
+                    case ShowFunction.Sensor:
+                        btnName.TextID = StringId.Sensor;
+                        functionPageTitleId = StringId.Sensor;
+                        break;
+                    case ShowFunction.VideoIntercom:
+                        btnName.TextID = StringId.VideoIntercom;
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+                        {
+                            var videoMethod = new UI2.FuntionControlView.Video.VideoMethod();
+                            videoMethod.MianView(this,FunctionList.List.videoIntercom);
+                        };
+                        break;
+                    case ShowFunction.SecurityCenter:
+                        btnName.TextID = StringId.SecurityCenter;
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+                        {
+                            var page = new ArmCenterPage();
+                            MainPage.BasePageView.AddChidren(page);
+                            page.LoadPage();
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        };
+                        break;
+
+                }
+                //鐣岄潰璺宠浆--闊充箰璺宠浆鑷繁鐨勭晫闈�--鐜璺宠浆鑷繁鐨勭晫闈�
+                if (item != ShowFunction.Music && item != ShowFunction.Environmental && item != ShowFunction.SecurityMonitoring
+                    && ShowFunction.EnergyMonitoring!= item && ShowFunction.VideoIntercom != item && ShowFunction.SecurityCenter != item)
+                {
+                    btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+                    {
+                        var skipView = new FunctionPage();
+                        MainPage.BasePageView.AddChidren(skipView);
+                        skipView.LoadPage(functionPageTitleId);
+                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                    };
+                }
                 index++;
             }
 
-            if (functionCategoryCount > 4)
+            //if (functionCategoryCount > 4)
             {
-                functionContentView.Height = Application.GetRealHeight((220 * functionCategoryCount / 2) + 20);
-                s1View.Height = s2View.Height = functionContentView.Height;
+                //functionContentView.Height = functionContentViewHeight;// Application.GetRealWidth((240 * (functionCategoryCount / 2)));
+                s1View.Height = s2View.Height = functionContentView.Height = functionContentViewHeight+ Application.GetRealWidth(40);
             }
 
-            #endregion
+#endregion
         }
 
         #region 鍒囨崲妤煎眰
@@ -921,7 +975,7 @@
                         Text = floor.roomName,
                         TextSize = CSS_FontSize.SubheadingFontSize,
                         IsSelected = floor.roomId == DB_ResidenceData.Instance.ClassificationChooseFloor.roomId,
-                        IsMoreLines = true,
+                        //IsMoreLines = true,
                     };
                     contentView.AddChidren(btnHomeName);
 

--
Gitblit v1.8.0