上面的树视图在左上角和左上角看阴影效果。我需要一条粗线。
我的xaml是
Margin="0,0,0,2" BorderBrush="Black" BorderThickness="1"
我需要一条线但不是一条shodow。你能帮帮我怎么做吗?
答案 0 :(得分:1)
执行此操作的一种方法是为您的Template
创建简单的TreeView
,如下所示:
<TreeView BorderBrush="Black" BorderThickness="1" Background="Beige">
<TreeView.Template>
<ControlTemplate TargetType="{x:Type TreeView}">
<Border
BorderBrush="{TemplateBinding BorderBrush}"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}">
<ScrollViewer>
<ItemsPresenter/>
</ScrollViewer>
</Border>
</ControlTemplate>
</TreeView.Template>
</TreeView>
答案 1 :(得分:0)
您可以尝试这样做以摆脱树视图边框并应用您自己的边框:
<Border BorderThickness="1" BorderBrush="Black">
<TreeView BorderBrush="Transparent" BorderThickness="0"
</TreeView>
</Border>