コード例 #1
0
 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;
 }
コード例 #2
0
 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;
 }
コード例 #3
0
        public static IBindingSubscription BindTwoWay <T>(this IObservableListBinding <T> source,
                                                          ObservableCollection <T> target)
        {
            var targetBinding = target.ToBinding();

            return(source.BindTwoWay(targetBinding));
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 public static IBindingSubscription BindTwoWay <T>(this IObservableListBinding <T> source,
                                                   IObservableListBinding <T> target)
 {
     return(new TwoWayListBinding <T>(target, source));
 }
コード例 #6
0
 public static IBindingSubscription BindTo <T>(this IReadOnlyObservableListBinding <T> source,
                                               IObservableListBinding <T> target)
 {
     return(new OneWayObservableListBinding <T>(target, source));
 }
コード例 #7
0
 public static IObservableValue <T> ItemAt <T>(this IObservableListBinding <T> source, int index, T defaultValue = default(T))
 {
     return(new IndexerBinding <T>(source, index, defaultValue));
 }
コード例 #8
0
 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;
 }
コード例 #9
0
 internal ListEnumerator(IObservableListBinding <T> widget) : this()
 {
     this.widget = widget;
     index       = -1;
     current     = default(T);
 }
コード例 #10
0
 public ListSynchronizer(IReadOnlyObservableListBinding <T> sourceList, IObservableListBinding <T> target)
 {
     SourceList = sourceList ?? throw new ArgumentNullException(nameof(sourceList));
     Target     = target ?? throw new ArgumentNullException(nameof(target));
 }