wxr
2023-08-09 10afb4f79299cae08344fd8245a7217ea49f712e
HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs
@@ -354,6 +354,7 @@
                {
                    var d = new Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.Brightness, e.ToString());
                    d.Add(FunctionAttributeKey.OnOff, e == 0 ? "off" : "on");
                    function.Control(d);
                }
                else
@@ -453,6 +454,7 @@
                {
                    var d = new Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.Brightness, e.ToString());
                    d.Add(FunctionAttributeKey.OnOff, e == 0 ? "off" : "on");
                    function.Control(d);
                }
                else
@@ -626,10 +628,10 @@
                ColorImagePath = "FunctionIcon/Light/ColorWheel.png",
            };
            framePickerBack.AddChidren(colorPicker);
            //if (function.trait_on_off.curValue.ToString() == "off")
            //{
            //    colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png";
            //}
            if (function.trait_on_off.curValue.ToString() == "off")
            {
                colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png";
            }
            //colorPicker.MouseDownEventHandler = (sender, e) => {
            //    MainPage.BasePageView.ScrollEnabled = false;
            //};
@@ -675,11 +677,12 @@
            colorPicker.MouseDownEventHandler += (sender, e) =>
            {
                pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y);
                if (pointIsRight == false)
                if (function.trait_on_off.curValue.ToString() == "off" || pointIsRight == false)
                {
                    //点的区域不是圆盘内
                    //pointIsRight:点的区域不是圆盘内
                    return;
                }
                //显示白点
                btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2;
                btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2;
@@ -694,8 +697,6 @@
                //当鼠标点下事件处理
                colorPicker.MouseDownEventHandler(sender, e);
            };
            #region 亮度调节
            var btnBrightnessText = new Button()
@@ -760,6 +761,7 @@
                {
                    var d = new Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.Brightness, e.ToString());
                    d.Add(FunctionAttributeKey.OnOff, e == 0 ? "off" : "on");
                    function.Control(d);
                }
                else
@@ -774,6 +776,22 @@
                            function.Control(d);
                        })
                        { IsBackground = true }.Start();
                    }
                }
                if (e == 0)
                {
                    if (function.trait_on_off.curValue.ToString() == "on")
                    {
                        function.SetAttrState(FunctionAttributeKey.OnOff, "off");
                        colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png";
                    }
                }
                else
                {
                    if (function.trait_on_off.curValue.ToString() == "off")
                    {
                        function.SetAttrState(FunctionAttributeKey.OnOff, "on");
                        colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheel.png";
                    }
                }
            };
@@ -796,10 +814,14 @@
                if (btnSwitch.IsSelected)
                {
                    dimmerBar.Progress = 100;
                    function.SetAttrState(FunctionAttributeKey.OnOff, "on");
                    colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheel.png";
                }
                else
                {
                    dimmerBar.Progress = 0;
                    function.SetAttrState(FunctionAttributeKey.OnOff, "off");
                    colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png";
                }
            };
            #endregion
@@ -902,9 +924,7 @@
                #endregion
                heightMore = 70;
            }
            if (hadColorful)
@@ -986,8 +1006,6 @@
                };
                #endregion
            }