public TwoWayListBinding(IObservableListBinding <T> source, IObservableListBinding <T> target) { this.forwardBinding = new ListSynchronizer <T>(source, target); this.forwardBinding.SourceList.CollectionChanged += OnSourceChanged; this.reverseBinding = new ListSynchronizer <T>(target, source); this.reverseBinding.SourceList.CollectionChanged += OnTargetChanged; }
public IndexerBinding(IObservableListBinding <T> source, int index, T defaultValue = default(T)) { this.source = source ?? throw new ArgumentNullException(nameof(source)); this.index = index; this.defaultValue = defaultValue; this.source.CollectionChanged += OnCollectionChanged; }
public static IBindingSubscription BindTwoWay <T>(this IObservableListBinding <T> source, ObservableCollection <T> target) { var targetBinding = target.ToBinding(); return(source.BindTwoWay(targetBinding)); }
public OneWayListBinding(IObservableListBinding <T> target, IReadOnlyObservableValue <IReadOnlyList <T> > sourceValue) { this.target = target ?? throw new ArgumentNullException(nameof(target)); this.sourceValue = sourceValue ?? throw new ArgumentNullException(nameof(sourceValue)); this.sourceValue.PropertyChanged += OnSourceValueChanged; target.Clear(); target.AddRange(sourceValue.Value); }
public static IBindingSubscription BindTwoWay <T>(this IObservableListBinding <T> source, IObservableListBinding <T> target) { return(new TwoWayListBinding <T>(target, source)); }
public static IBindingSubscription BindTo <T>(this IReadOnlyObservableListBinding <T> source, IObservableListBinding <T> target) { return(new OneWayObservableListBinding <T>(target, source)); }
public static IObservableValue <T> ItemAt <T>(this IObservableListBinding <T> source, int index, T defaultValue = default(T)) { return(new IndexerBinding <T>(source, index, defaultValue)); }
public OneWayObservableListBinding(IObservableListBinding <T> target, IReadOnlyObservableListBinding <T> sourceList) { this.Target = target ?? throw new ArgumentNullException(nameof(target)); this.SourceList = sourceList ?? throw new ArgumentNullException(nameof(sourceList)); this.SourceList.CollectionChanged += OnSourceCollectionChanged; }
internal ListEnumerator(IObservableListBinding <T> widget) : this() { this.widget = widget; index = -1; current = default(T); }
public ListSynchronizer(IReadOnlyObservableListBinding <T> sourceList, IObservableListBinding <T> target) { SourceList = sourceList ?? throw new ArgumentNullException(nameof(sourceList)); Target = target ?? throw new ArgumentNullException(nameof(target)); }