| | |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | Application.RunOnMainThread((Action)(() => |
| | | { |
| | | if (bodyView == null) |
| | | { |
| | |
| | | // bodyView.arcBar.IsOffline = true; |
| | | //} |
| | | |
| | | if (updateTemp.trait_on_off.curValue.ToString() == "on") |
| | | if (updateTemp.trait_on_off.state.ToString() == "on") |
| | | { |
| | | bodyView.arcBar.IsOffline = false; |
| | | bodyView.btnSwitch.IsSelected = true; |
| | |
| | | } |
| | | |
| | | |
| | | }); |
| | | })); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | { |
| | | btnMinus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if(function.trait_on_off.curValue.ToString() == "off") |
| | | if(function.trait_on_off.state.ToString() == "off") |
| | | { |
| | | return; |
| | | } |
| | |
| | | }; |
| | | btnPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | if (function.trait_on_off.state.ToString() == "off") |
| | | { |
| | | return; |
| | | } |
| | |
| | | { |
| | | btnMode.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | if (function.trait_on_off.state.ToString() == "off") |
| | | { |
| | | return; |
| | | } |
| | |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | if (function.trait_on_off.curValue.ToString() == "on") |
| | | function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off"; |
| | | if (function.trait_on_off.state.ToString() == "on") |
| | | { |
| | | //arcBar.ProgressBarColor = CSS_Color.MainColor; |
| | | arcBar.ThumbImagePath = "FunctionIcon/FloorHeating/DiyThumbIconOn.png"; |
| | |
| | | arcBar.IsOffline = true; |
| | | } |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); |
| | | d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | |
| | | }; |