public void Rebind(THost host, ICollection <TProperty> nullCollection, ICollection <TProperty> collection) { var lazyCollection = collection as LazyEntityCollection <TProperty>; if (lazyCollection != null) { lazyCollection.ItemAdded += x => CollectionProperty.Add(x, _inverse, host); lazyCollection.ItemRemoved += x => CollectionProperty.Remove(x, _inverse, host); } foreach (var x in collection) { CollectionProperty.Add(x, _inverse, host); } }
public void Rebind(THost host, TProperty previousValue, TProperty value) { CollectionProperty.Remove(previousValue, _inverse, host); CollectionProperty.Add(value, _inverse, host); }