在一个窗口中以两种不同的方式设置WPF树的样式

时间:2019-01-30 16:33:24

标签: c# wpf treeview styles

嗨,我正在尝试为两个wpf树设置两种样式。但是,当我将sytle添加到一棵树上时(请参见左侧的图像),它仅将样式应用于一级。我该如何在每个级别上使用“加线”样式?

enter image description here

<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>

0 个答案:

没有答案