| | |
| | | { |
| | | Application.RunOnMainThread((Action)(() => |
| | | { |
| | | |
| | | try |
| | | { |
| | | if (view == null || scrolView == null || updataFunction == null) |
| | |
| | | { |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.curValue.ToString() == "on"; |
| | | (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.state.ToString() == "on"; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as DiyImageSeekBar).Progress = Convert.ToInt32(updataFunction.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | if (updataFunction.trait_on_off.curValue.ToString() == "on") |
| | | if (updataFunction.trait_on_off.state.ToString() == "on") |
| | | { |
| | | (fcView.GetChildren(j) as DiyImageSeekBar).ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1; |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.curValue.ToString() == "on"; |
| | | (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.state.ToString() == "on"; |
| | | (fcView.GetChildren(j) as Button).Text = updataFunction.lastState; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | #endregion |
| | | case FunctionCategory.Curtain: |
| | | #region 窗帘更新 |
| | | var percent = updataFunction.GetAttrState(FunctionAttributeKey.OnOff) == "off" ? 0 : 100; |
| | | var onoffString = updataFunction.GetAttrState(FunctionAttributeKey.OnOff); |
| | | if (onoffString == "stop") |
| | | { |
| | | return; |
| | | } |
| | | var percent = onoffString == "off" ? 0 : 100; |
| | | if(updataFunction.GetAttributes().Contains(FunctionAttributeKey.Percent)) |
| | | { |
| | | string percentString = updataFunction.GetAttrState(FunctionAttributeKey.Percent); |