public bool IsVisibleRootNode(TreeViewItem item) { return ((item.parent != null) && (item.parent.parent == null)); }