private void AddNodeToTree(Roslyn.Compilers.VisualBasic.SyntaxNode codeNode, ItemsControl parent) { var newNode = new TreeViewItem(); newNode.Header = codeNode.GetType().Name; newNode.ToolTip = codeNode.ToFullString(); parent.Items.Add(newNode); foreach (var childCodeName in codeNode.ChildNodes()) { AddNodeToTree(childCodeName, newNode); } }