Пример #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);
 }