Ejemplo n.º 1
0
        protected virtual void OnSourceChanged(MyObservableCollection <T> oldSource)
        {
            if (oldSource != null)
            {
                oldSource.ItemAttached -= Source_ItemAttached;
                oldSource.ItemDetached -= Source_ItemDetached;
            }
            this.Synced.Clear();
            this.Source.ItemAttached += Source_ItemAttached;
            this.Source.ItemDetached += Source_ItemDetached;
            this.Source.ForEach(item => this.Synced.Add(item));

            SourceChanged?.Invoke(this, oldSource);
        }
Ejemplo n.º 2
0
        protected virtual void OnSourceChanged(MyObservableCollection <T> oldSource)
        {
            oldSource.ItemAttached -= Source_ItemAttached;
            oldSource.ItemDetached -= Source_ItemDetached;
            oldSource.ItemMoved    -= Source_ItemMoved;

            this.Synced.Clear();
            var internalFilter = this.InternalFilter;

            this.sourceFilterResults  = this.Source.Select(item => internalFilter(item)).ToList();
            this.Source.ItemAttached += Source_ItemAttached;
            this.Source.ItemDetached += Source_ItemDetached;
            this.Source.ItemMoved    += Source_ItemMoved;
            this.Source.Where(item => InternalFilter(item))
            .ForEach(item => this.Synced.Add(item));

            SourceChanged?.Invoke(this, oldSource);
        }
Ejemplo n.º 3
0
 public SyncedObservableCollection_Simple(MyObservableCollection <T> source, ObservableCollection <T> synced, IEqualityComparer <T> equalityComparer)
 {
     this.Synced           = synced;
     this.Source           = source;
     this.EqualityComparer = equalityComparer;
 }
Ejemplo n.º 4
0
 public SyncedObservableCollection_Simple(MyObservableCollection <T> source, IEqualityComparer <T> equalityComparer)
     : this(source, new ObservableCollection <T>(), equalityComparer)
 {
 }
Ejemplo n.º 5
0
 public SyncedObservableCollection_Simple(MyObservableCollection <T> source) : this(source, null)
 {
 }
Ejemplo n.º 6
0
 public SyncedObservableCollection(MyObservableCollection <T> source, ObservableCollection <T> synced)
 {
 }
Ejemplo n.º 7
0
 public SyncedObservableCollection(MyObservableCollection <T> source) : this(source, new ObservableCollection <T>())
 {
 }
Ejemplo n.º 8
0
 public SyncedObservableCollection_View(MyObservableCollection <T> source, IEqualityComparer <T> equalityComparer)
     : base(source, equalityComparer)
 {
 }