protected virtual ObservableBindBox CreatePropertyBindBox(object instance, PropertyInfo propertyInfo) { var propertyBox = NotifyPropertyMap[propertyInfo.Name]; var section = Configuration.GetSection(propertyBox.Name); var box = new ObservableBindBox(ChangeNotifyable, section, new BindSettings(instance, BindSettings.DelayTime, BindSettings.Conditions), Mode, Updater); box.UpdateMode = UpdateMode; return(box); }
public static ObservableBindBox BindNotifyNotify(this IConfigurationChangeNotifyable notifyable, BindSettings bindSettings, ConfigBindMode configBindMode) { if (notifyable is null) { throw new ArgumentNullException(nameof(notifyable)); } if (bindSettings is null) { throw new ArgumentNullException(nameof(bindSettings)); } var updater = bindSettings.Updater; if (updater is null) { updater = a => a(); } var box = new ObservableBindBox(notifyable, bindSettings, configBindMode, updater); box.Bind(); return(box); }