mac
2024-07-25 f9181a9c8125136f597add7c30cb2ff508d54ba7
HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupChooseRoomPage.cs
@@ -60,14 +60,14 @@
        public void LoadPage()
        {
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            new TopViewDiv(bodyView, Language.StringByID(StringId.CombinedDimming)).LoadTopView();
            var topView = new TopViewDiv(bodyView, Language.StringByID(StringId.CombinedDimming));
            topView.maginY = 10;
            topView.LoadTopView();
            var contentView = new VerticalScrolViewLayout()
            contentView = new VerticalScrolViewLayout()
            {
                Y = Application.GetRealHeight(64),
                Height = Application.GetRealHeight(667 - 64),
                Y = Application.GetRealHeight(64+10),
                Height = Application.GetRealHeight(667 - 64-10),
            };
            bodyView.AddChidren(contentView);
@@ -176,41 +176,50 @@
        /// </summary>
        void LoadMethod_AllElection()
        {
            btnAllRoomText.MouseUpEventHandler += (sender, e) =>
            btnAllRoomText.MouseUpEventHandler = (sender, e) =>
            {
                btnChooseAll.IsSelected = !btnChooseAll.IsSelected;
                for (int i = 0; i < contentView.ChildrenCount; i++)
                try
                {
                    var view = contentView.GetChildren(i);
                    if (view.GetType() == typeof(FrameLayout))
                    btnChooseAll.IsSelected = !btnChooseAll.IsSelected;
                    for (int i = 0; i < contentView.ChildrenCount; i++)
                    {
                        if (view.Tag != null && view.Tag.ToString() == "row")
                        var view = contentView.GetChildren(i);
                        if (view.GetType() == typeof(FrameLayout))
                        {
                            for (int j = 0; j < (view as FrameLayout).ChildrenCount; j++)
                            if (view.Tag != null && view.Tag.ToString() == "row")
                            {
                                var btn = (view as FrameLayout).GetChildren(j);
                                if (btn.GetType() == typeof(Button))
                                for (int j = 0; j < (view as FrameLayout).ChildrenCount; j++)
                                {
                                    if (btn.Tag != null && btn.Tag.ToString() == "ChooseIcon")
                                    var btn = (view as FrameLayout).GetChildren(j);
                                    if (btn.GetType() == typeof(Button))
                                    {
                                        (btn as Button).IsSelected = btnChooseAll.IsSelected;
                                        if (btn.Tag != null && btn.Tag.ToString() == "ChooseIcon")
                                        {
                                            (btn as Button).IsSelected = btnChooseAll.IsSelected;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                function.roomIds.Clear();
                if (btnChooseAll.IsSelected)
                {
                    foreach (var room in Entity.SpatialInfo.CurrentSpatial.RoomList)
                    function.roomIds.Clear();
                    if (btnChooseAll.IsSelected)
                    {
                        if (btnChooseAll.IsSelected)
                        foreach (var room in Entity.SpatialInfo.CurrentSpatial.RoomList)
                        {
                            function.roomIds.Add(room.roomId);
                            if (btnChooseAll.IsSelected)
                            {
                                function.roomIds.Add(room.roomId);
                            }
                        }
                    }
                }catch(Exception ex)
                {
                    MainPage.Log($"GroupChooseRoom 全选按钮事件 error : {ex.Message}");
                    Application.RunOnMainThread(() => {
                        this.RemoveFromParent();
                    });
                }
            };
        }