public IControlBinder <TSource, TControl> Bind <TSourceMember>(Expression <Func <TSource, TSourceMember> > sourceMember, DataSourceUpdateMode dataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged) { var binding = _parent.CreateBinding(_memberName, sourceMember.GetAccessorName(), true, ControlUpdateMode.OnPropertyChanged, dataSourceUpdateMode); _parent.AddDataBinding(binding); return(_parent); }
public IControlBinder <TSource, TControl> Bind( Expression <Func <TSource, TControlProp> > sourceMember, DataSourceUpdateMode dataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged) { var sourcePropertyName = sourceMember.GetAccessorName(); var sourcePropertyType = sourceMember.GetAccessorType(); var formattingEnabled = sourcePropertyType != typeof(TControlProp); var binding = _parent.CreateBinding(_propertyName, sourcePropertyName, formattingEnabled, ControlUpdateMode.OnPropertyChanged, dataSourceUpdateMode); _parent.AddDataBinding(binding); return(_parent); }