| | |
| | | // function.CollectFunction(); |
| | | //}; |
| | | |
| | | |
| | | |
| | | |
| | | //回退刷新信息事件 |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.GroupControl)).LoadTopView_SettingIcon( () => { |
| | | var page = new AddGroupControlPage(function, |
| | |
| | | attrView.AddChidren(btnSwitchIcon); |
| | | |
| | | btnSwitchIcon.MouseUpEventHandler = (sender, e) => { |
| | | btnSwitchIcon.IsSelected = !btnSwitchIcon.IsSelected; |
| | | if (btnSwitchIcon.IsSelected) |
| | | { |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, "off"); |
| | | function.Control(d); |
| | | } |
| | | else |
| | | { |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, "on"); |
| | | function.Control(d); |
| | | } |
| | | else |
| | | { |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, "off"); |
| | | function.Control(d); |
| | | } |
| | | }; |
| | | |
| | | btnOn.MouseUpEventHandler += (sender, e) => { |
| | | btnSwitchIcon.IsSelected = true; |
| | | }; |
| | | btnOff.MouseUpEventHandler += (sender, e) => { |
| | | btnSwitchIcon.IsSelected = false; |
| | | }; |
| | | } |
| | | |
| | |
| | | |
| | | dimmerBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | //btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | //btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | return; |
| | | if (e == 0 && lastBrightness != 0) |
| | | { |
| | |
| | | |
| | | btnOn.MouseUpEventHandler += (sender, e) => { |
| | | dimmerBar.Progress = 100; |
| | | btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | //btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | //btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | btnOff.MouseUpEventHandler += (sender, e) => { |
| | | dimmerBar.Progress = 0; |
| | | btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | //btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); |
| | | //btnBrightnessText.Text = dimmerBar.Progress + "%"; |
| | | }; |
| | | |
| | | |