Example #1
0
        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();
        }
Example #2
0
 internal virtual void ProcessItemsCollectionChanged(CollectionChangedInfo collectionChangedInfo)
 {
     OnItemsCollectionChanged(collectionChangedInfo);
 }
Example #3
0
        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);
        }