public Bind <TBinding> WithConverter <TSource>( Expression <Func <TBinding, TSource> > member, SourceToControlConverter <TSource, TProperty> converter) { var propertyName = ReflectionUtils.GetPropertyName(_controlProperty); var dataMember = ReflectionUtils.GetFullPath(member); var binding = new ConversionBinding <TSource, TProperty>(propertyName, _item, dataMember, converter); _control.DataBindings.Add(binding); return(this); }
public ConversionBinding( string propertyName, object dataSource, string dataMember, SourceToControlConverter <TSource, TDestination> converter) { _propertyName = propertyName; _dataSource = dataSource; _dataMember = dataMember; _converter = converter; }
private void ConvertValue(SourceToControlConverter <TSource, TDestination> converter, ConvertEventArgs e) { e.Value = converter.Convert((TSource)e.Value); }