public IBinder <int> Add <TSource>(NumericUpDown numericUpDown, Func <TSource> entityGetter, Expression <Func <TSource, int> > resultSelector) { var binder = new NumericBinder <TSource>(entityGetter, resultSelector); binder.Bind(numericUpDown); _binders.Add(binder); binder.OnChanged += AddToTrackerHandler; binder.OnChanged += (sender, args) => BindValueChange?.Invoke(sender, EventArgs.Empty); return(binder); }
public IBinder <TResult> Add <TSource, TResult>(ComboBox comboBox, Func <TSource> entityGetter, Expression <Func <TSource, TResult> > resultSelector) { var binder = new ComboboxBinder <TSource, TResult>(entityGetter, resultSelector); binder.Bind(comboBox); _binders.Add(binder); binder.OnChanged += AddToTrackerHandler; binder.OnChanged += (sender, args) => BindValueChange?.Invoke(sender, EventArgs.Empty); return(binder); }
public IBinder <string> Add <TSource>(TextBox textBox, Func <TSource> entityGetter, Expression <Func <TSource, string> > resultSelector) { var binder = new TextboxBinder <TSource>(entityGetter, resultSelector); binder.Bind(textBox); _binders.Add(binder); binder.OnChanged += AddToTrackerHandler; binder.OnChanged += (sender, args) => BindValueChange?.Invoke(sender, EventArgs.Empty); return(binder); }