예제 #1
0
        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);
        }
예제 #2
0
 public ConversionBinding(
     string propertyName,
     object dataSource,
     string dataMember,
     SourceToControlConverter <TSource, TDestination> converter)
 {
     _propertyName = propertyName;
     _dataSource   = dataSource;
     _dataMember   = dataMember;
     _converter    = converter;
 }
예제 #3
0
 private void ConvertValue(SourceToControlConverter <TSource, TDestination> converter, ConvertEventArgs e)
 {
     e.Value = converter.Convert((TSource)e.Value);
 }