Exemplo n.º 1
0
        public static void AddInverseBinding <TControl>(this TControl control, string propertyName, object dataSource, string dataMember)
            where TControl : Control
        {
            var inverseBinding = new ConversionBinding <bool, bool>(
                propertyName,
                dataSource,
                dataMember,
                converter: new InverseBoolConverter());

            control.AddBinding(inverseBinding);
        }
Exemplo n.º 2
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);
        }