Beispiel #1
0
        private void SetEntityDataBindings(MVVMContextFluentAPI <BackupViewModel> fluent)
        {
            //TODO - See if there's a simpler way to do this, this feels really... old fashioned.
            var entityBindingSource = new BindingSource {
                DataSource = typeof(SMOBackupProcess)
            };

            SetEntityBindingsForTextEdits(entityBindingSource);
            SetEntityBindingsForCheckEdits(entityBindingSource);
            spinEditExpireAfterDays.DataBindings.Add(new Binding("EditValue", entityBindingSource, "ExpireAfterDays",
                                                                 true,
                                                                 DataSourceUpdateMode.OnPropertyChanged));
            dateEditExpireOnDate.DataBindings.Add(new Binding("EditValue", entityBindingSource, "ExpireDate", true,
                                                              DataSourceUpdateMode.OnPropertyChanged));
            SetEntityBindingsForComboBoxes(entityBindingSource);
            fluent.SetObjectDataSourceBinding(entityBindingSource, x => x.BackupEntityForVm, x => x.Update());
        }