| | |
| | | /// </summary> |
| | | void LoadEvent_DimmerBar() |
| | | { |
| | | dimmerBar.OnStartTrackingTouchEvent = (sender, e) => { |
| | | onDimmerBar = true; |
| | | }; |
| | | dimmerBar.OnStopTrackingTouchEvent = (sender, e) => { |
| | | onDimmerBar = false; |
| | | function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | //20201223 删除滑动发送命令,防止控件跳动 |
| | | dimmerBar.OnProgressChangedEvent = (sender, e) => |
| | | //if (function.online) |
| | | { |
| | | dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); |
| | | dimmerBar.OnStartTrackingTouchEvent = (sender, e) => |
| | | { |
| | | onDimmerBar = true; |
| | | }; |
| | | dimmerBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | onDimmerBar = false; |
| | | function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | //20201223 删除滑动发送命令,防止控件跳动 |
| | | dimmerBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); |
| | | //function.fadeTime = 0; |
| | | //if (!btnSwitch.IsSelected) |
| | | //{ |
| | |
| | | // } |
| | | //} |
| | | btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(288 - 16 - 16) / 100) + Application.GetRealWidth(40); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载开关事件 |
| | | /// </summary> |
| | |
| | | { |
| | | btnSwitch.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | //if (!function.online) |
| | | //{ |
| | | // new Tip() |
| | | // { |
| | | // CloseTime = 1, |
| | | // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | // Direction = AMPopTipDirection.None, |
| | | // }.Show(MainPage.BaseView); |
| | | // return; |
| | | //} |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | if (btnSwitch.IsSelected) |
| | | { |