Since the OP said my comment was really what he considered an answer, I figured I'd go ahead and turn it into an answer.
What is described in the question is exactly how you could do it in WPF. For instance:
var item = new TreeViewItem();
myTreeView.Items.Add(item);
var subItem1 = new TreeViewItem();
var subItem2 = new TreeViewItem();
item.Items.Add(subItem1);
item.Items.Add(subItem2);
That'll add a bunch of blank items.
You can use the Header property of each TreeViewItem to control what is displayed and use the Tag property to hold data, if you want to go that route.
It would likely be preferable, however, to go the binding route and use HierarchicalDataTemplates to control the look. That way you're not manually creating these fake containers (the TreeViewItems) for your data.
I'd suggest reading up on HierarchicalDataTemplates, as that'll give you a decent overview of how the process should work with bindings. Also just read up on MVVM in general.
var item = new TreeViewItem(); myTreeView.Items.Add(item); var subItem1 = new TreeViewItem(); var subItem2 = new TreeViewItem(); item.Items.Add(subItem1); item.Items.Add(subItem2);Or do it as part of a loop. I don't see what the problem is.