private void Nodes_ItemsAdded(object sender, ObservableListModified <TreeNode> e) { foreach (var node in e.Items) { node.ParentNode = this; node.ParentTree = ParentTree; } if (ParentTree != null && ParentTree.TreeViewNodeSorter != null) { Nodes.Sort(ParentTree.TreeViewNodeSorter); } ItemsAdded?.Invoke(this, e); }
private void Nodes_ItemsAdded(object sender, ObservableListModified <TreeNode> e) { foreach (var node in e.Items) { node.ParentTree = this; node.IsRoot = true; HookNodeEvents(node); } if (TreeViewNodeSorter != null) { Nodes.Sort(TreeViewNodeSorter); } UpdateNodes(); }