main
1using System;
2using System.Windows.Forms;
3
4namespace MoMoney.Presentation.Winforms.Databinding
5{
6 public class DateTimePickerPropertyBinding<TypeToBindTo> : IPropertyBinding<DateTime>
7 {
8 private readonly IPropertyBinder<TypeToBindTo, DateTime> binder;
9
10 public DateTimePickerPropertyBinding(DateTimePicker control, IPropertyBinder<TypeToBindTo, DateTime> binder)
11 {
12 this.binder = binder;
13 control.ValueChanged += (o, e) => binder.change_value_of_property_to(control.Value);
14 }
15
16 public DateTime current_value()
17 {
18 return binder.current_value();
19 }
20 }
21}