Esempio n. 1
0
 public void ExplicitBind(ContactViewModel vm)
 {
     Binder = new ViewBinder<ContactViewModel>(this, vm);
     Binder.Value(FirstName, TextBox.TextProperty, p =>p.FirstName);
     Binder.Value(LastName, TextBox.TextProperty, p => p.LastName);
     Binder.Value(Address, TextBox.TextProperty, p => p.Address);
     Binder.Action(Save, EventNames.Click, p => vm.Save(), p => vm.IsSaveEnabled);
     Binder.List(Cities, p => vm.Cities, p => vm.SelectedCities);
     Binder.Bind();
 }
Esempio n. 2
0
        public void ExplicitBindWithConventions(ContactViewModel vm)
        {
            Binder = ViewBinder.For(this, vm).
                Value(p => p.FirstName).
                Value(p=>p.LastName).
                Value(p => p.Address).
                AddBinder(new ValueBinder<ContactViewModel>(this.OnMailingList, vm)).
                List(p => p.Cities).
                Action(p => vm.Save()).
                Template<City>("City", t => t.Value(p => p.CityName));

            Binder.Bind();
        }
Esempio n. 3
0
 public Window2()
 {
     InitializeComponent();
     ContactViewModel vm = new ContactViewModel() { FirstName = "Jeff", LastName = "Handley", Address = "123 Any Street" };
     this.DataContext = vm;
 }
Esempio n. 4
0
        private void Bind()
        {
            ContactViewModel vm = new ContactViewModel() { FirstName = "Jeff", LastName = "Handley", Address = "123 Any Street" };

            //ExplicitBind(vm);
            ExplicitBindWithConventions(vm);
            //ConventionallyBind(vm);
        }
Esempio n. 5
0
 public void ConventionallyBind(ContactViewModel vm)
 {
     Binder = ConventionalViewBinder.For(this, vm);
     Binder.Bind();
 }