更新时间:2022-05-20 02:57:21
您可以只设置:
treeView1.ItemsSource = coldDrinks;
不过,我怀疑这里使用一个TreeView的。你显然呈现出平整,无分层数据,因此没有理由用一个TreeView。
However, I question the use of a TreeView here. You're obviously showing flat, non-hierarchical data, so there is no reason to use a TreeView.
为什么不直接使用一个ListView或列表框?
Why not just use a ListView or ListBox?