| | |
| | | /// </summary> |
| | | public event Action<HydroVisualViewModel> HydroViewEvent; |
| | | |
| | | //属性状态辅助类 |
| | | private HydroPropStatusHelper _propStatusHelper = null; |
| | | |
| | | /// <summary> |
| | | /// 初始化数据 |
| | | /// </summary> |
| | | public void InitialData(HydroPropStatusHelper propStatusHelper) |
| | | { |
| | | _propStatusHelper = propStatusHelper; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 允许修改 |
| | |
| | | var vm = GetPropertyViewModel(e.Row); |
| | | if (vm != null) |
| | | { |
| | | //var propStatus = vm.GetPropStatus(realFieldName); |
| | | //if (propStatus != null) |
| | | //{ |
| | | // e.Appearance.ForeColor = HydroPropStatusHelper.GetColor(propStatus.PropStatus); |
| | | //} |
| | | var propStatusInfo = _propStatusHelper?.GetPropStatusInfo(vm.Code, realFieldName); |
| | | if (propStatusInfo != null) |
| | | { |
| | | e.Appearance.ForeColor = HydroPropStatusColorHelper.GetColor(propStatusInfo.PropStatus); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | string caption = string.Empty; |
| | | string descrition = string.Empty; |
| | | |
| | | string realFieldName = fieldName; |
| | | |
| | | |
| | | //属性描述器 |
| | |
| | | { |
| | | descrition = descritionAttri.Description; |
| | | } |
| | | |
| | | //真实属性名称 |
| | | var realPropAttri = (HydroRealProAttribute)descriptor.Attributes[typeof(HydroRealProAttribute)]; |
| | | if (realPropAttri != null) |
| | | { |
| | | realFieldName = realPropAttri.RealPropName; |
| | | } |
| | | } |
| | | |
| | | //var propStatus = vm.GetPropStatus(fieldName); |
| | | //this.hydroVisualPropertyDescriptionCtrl1.SetBindingData(caption, descrition, propStatus); |
| | | var propStatusInfo = _propStatusHelper?.GetPropStatusInfo(vm.Code, realFieldName); |
| | | this.hydroVisualPropertyDescriptionCtrl1.SetBindingData(caption, descrition, propStatusInfo); |
| | | |
| | | } |
| | | |