<TreeView Name="treeView" DockPanel.Dock="Left" MinWidth="200" >
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding cell}" DataType="{x:Type local:test1}" >
<StackPanel Orientation="Horizontal" >
<TextBlock VerticalAlignment="Center" Text="{Binding id}"/>
<TextBlock VerticalAlignment="Center" Text="{Binding no}"/><!--需要加入这一行才会正确显示子节点 -->
</StackPanel>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
04-23 07:41