protected override UIElementCollection CreateUIElementCollection(FrameworkElement logicalParent) { //ObservableUIElementCollection collec = new ObservableUIElementCollection(this, logicalParent); collec = new ObservableUIElementCollection(this, logicalParent); collec.CollectionChanged += new NotifyCollectionChangedEventHandler(modificationHandler); return(collec); //return new ObservableUIElementCollection(this, logicalParent); }
protected override UIElementCollection CreateUIElementCollection(FrameworkElement logicalParent) { var oldObservableCollection = InternalChildren as INotifyCollectionChanged; if (oldObservableCollection != null) { oldObservableCollection.CollectionChanged -= OnChildrenChanged; } var collection = new ObservableUIElementCollection(this, logicalParent); collection.CollectionChanged += OnChildrenChanged; return(collection); }
public SplitPanel() { Items = new ObservableUIElementCollection(); Items.CollectionChanged += Items_CollectionChanged; }