Exemple #1
0
        public Bind <TBinding> For <TControl, TProperty>(TControl control, Expression <Func <TControl, TProperty> > controlProperty, Expression <Func <TBinding, TProperty> > member, Func <TBinding, BindableObject> dependsOn)
            where TControl : Control
        {
            var binding = control.DataBindings.Add(ReflectionUtils.GetPropertyName(controlProperty), _item, ReflectionUtils.GetPropertyName(member));

            dependsOn(_item).PropertyChanged += (sender, args) => binding.ReadValue();
            return(this);
        }
Exemple #2
0
 /// <summary>
 /// Binds <see cref="TextBox.Text"/> of <paramref name="textBox"/> to <paramref name="member"/>
 /// </summary>
 /// <param name="textBox"></param>
 /// <param name="member"></param>
 /// <returns></returns>
 public Bind <TBinding> For(TextBox textBox, Expression <Func <TBinding, string> > member)
 {
     textBox.AddBinding(_item, ReflectionUtils.GetPropertyName(member));
     return(this);
 }
Exemple #3
0
 public Bind <TBinding> For <TControl, TProperty>(TControl control, Expression <Func <TControl, TProperty> > controlProperty, Expression <Func <TBinding, TProperty> > member)
     where TControl : Control
 {
     control.DataBindings.Add(ReflectionUtils.GetPropertyName(controlProperty), _item, ReflectionUtils.GetFullPath(member));
     return(this);
 }