main
1using System;
2using System.Linq.Expressions;
3
4namespace MoMoney.Presentation.Winforms.Helpers
5{
6 public class RebindTextBoxCommand<T> : ITextBoxCommand<T>
7 {
8 readonly Expression<Func<string, T>> binder;
9
10 public RebindTextBoxCommand(Expression<Func<string, T>> binder)
11 {
12 this.binder = binder;
13 }
14
15 public void run(IBindableTextBox<T> item)
16 {
17 item.bind_to(binder.Compile()(item.text()));
18 }
19 }
20}