| | |
| | | { |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Brightness, e.ToString()); |
| | | d.Add(FunctionAttributeKey.OnOff, e == 0 ? "off" : "on"); |
| | | function.Control(d); |
| | | } |
| | | else |
| | |
| | | { |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Brightness, e.ToString()); |
| | | d.Add(FunctionAttributeKey.OnOff, e == 0 ? "off" : "on"); |
| | | function.Control(d); |
| | | } |
| | | else |
| | |
| | | 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; |
| | | //}; |
| | |
| | | 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; |
| | |
| | | //当鼠标点下事件处理 |
| | | colorPicker.MouseDownEventHandler(sender, e); |
| | | }; |
| | | |
| | | |
| | | |
| | | #region 亮度调节 |
| | | var btnBrightnessText = new Button() |
| | |
| | | { |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Brightness, e.ToString()); |
| | | d.Add(FunctionAttributeKey.OnOff, e == 0 ? "off" : "on"); |
| | | function.Control(d); |
| | | } |
| | | else |
| | |
| | | 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"; |
| | | } |
| | | } |
| | | }; |
| | |
| | | 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 |
| | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | heightMore = 70; |
| | | |
| | | } |
| | | |
| | | if (hadColorful) |
| | |
| | | }; |
| | | |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | |
| | | |