嗨,我正在尝试为两个wpf树设置两种样式。但是,当我将sytle添加到一棵树上时(请参见左侧的图像),它仅将样式应用于一级。我该如何在每个级别上使用“加线”样式?
<TreeView x:Name="treeView1" ItemContainerStyle="{DynamicResource Style1}" BorderThickness="0,1,0,0" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="1" Grid.RowSpan="1" />
在:
<Windows.Resources>
<Style x:Key="Style1" TargetType="{x:Type TreeViewItem}">
...
</Style>
</Windwos.Resoures>