更新时间:2023-12-06 17:15:10
你可以很容易地做到这一点.只需将您的子 TreeViewItems 直接添加到父项,就像这样(C#,但很清楚)
You can do it quite easily. Simply add your child TreeViewItems directly to the parent item, like so (C#, but very clear)
var parent = new TreeViewItem();
var child = new TreeViewItem();
parent.Header = "Hey";
child.Header = "There!";
parent.Items.Add(child);
treeView1.Items.Add(parent);