public void RemoveAllChildren() { foreach (ITreeItem child in children) { child.Parent = null; } children.Clear(); ChildrenCleared?.Invoke(this, EventArgs.Empty); }
public virtual void ClearChildren() { while (Children.Count > 0) { GraphicObject g = Children[Children.Count - 1]; g.LayoutChanged -= OnChildLayoutChanges; g.ClearBinding(); g.Parent = null; Children.RemoveAt(Children.Count - 1); } resetChildrenMaxSize(); this.RegisterForLayouting(LayoutingType.Sizing); ChildrenCleared.Raise(this, new EventArgs()); }
public virtual void ClearChildren() { childrenRWLock.EnterWriteLock(); while (Children.Count > 0) { GraphicObject g = Children [Children.Count - 1]; g.LayoutChanged -= OnChildLayoutChanges; Children.RemoveAt(Children.Count - 1); g.Dispose(); } childrenRWLock.ExitWriteLock(); resetChildrenMaxSize(); this.RegisterForLayouting(LayoutingType.Sizing); ChildrenCleared.Raise(this, new EventArgs()); }