protected virtual void OnItemsCollectionChanged(CollectionChangedInfo collectionChangedInfo) { if (collectionChangedInfo.ChangeType == eCollectionChangeType.Adding || collectionChangedInfo.ChangeType == eCollectionChangeType.Removing || collectionChangedInfo.ChangeType == eCollectionChangeType.Clearing) { if (collectionChangedInfo.Removed != null) { foreach (VisualItem item in collectionChangedInfo.Removed) item.Parent = null; } if (collectionChangedInfo.ChangeType == eCollectionChangeType.Clearing) { foreach (VisualItem item in this.Items) item.Parent = null; } if (collectionChangedInfo.Added != null) { foreach (VisualItem item in collectionChangedInfo.Added) { if (item.Parent != null && item.Parent != this) { item.Parent.Items.Remove(item); } item.Parent = this; } } } this.InvalidateArrange(); }
internal virtual void ProcessItemsCollectionChanged(CollectionChangedInfo collectionChangedInfo) { OnItemsCollectionChanged(collectionChangedInfo); }
protected override void OnItemsCollectionChanged(CollectionChangedInfo collectionChangedInfo) { if (collectionChangedInfo.ChangeType == eCollectionChangeType.Adding || collectionChangedInfo.ChangeType == eCollectionChangeType.Removing || collectionChangedInfo.ChangeType == eCollectionChangeType.Clearing) { if (collectionChangedInfo.Added != null) { foreach (VisualItem item in collectionChangedInfo.Added) { VisualInputBase v = item as VisualInputBase; if (v != null) { v.IsReadOnly = this.IsReadOnly; v.AutoOverwrite = _AutoOverwrite; } } } } base.OnItemsCollectionChanged(collectionChangedInfo); }