| | |
| | | { |
| | | btnSwitchIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btnSwitchIcon.IsSelected = !btnSwitchIcon.IsSelected; |
| | | btnSwitch.IsSelected = btnSwitchIcon.IsSelected = !btnSwitchIcon.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | light.on_off = btnSwitchIcon.IsSelected ? "on" : "off"; |
| | |
| | | }; |
| | | btnSwitch.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | btnSwitchIcon.IsSelected = btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | light.on_off = btnSwitch.IsSelected ? "on" : "off"; |