H开发者_如何学Cow can you set the border of list view items thanks.
You can set your border in the ControlTemplate, something like below:
<Style x:Key="BorderedListView" TargetType="ListViewItem">
<Setter Property="Template">
<Setter.Value> <ControlTemplate TargetType="ListViewItem">
<Border Name="Border" BorderBrush="Transparent"
BorderThickness="3">
<ContentPresenter />
</Border>
</ControlTemplate> </Setter.Value>
</Setter>
</Style>
After you set the border in the ControlTemplate, you can set the following style in ListView :
<ListView ItemContainerStyle="{StaticResource BorderedListView}" />
精彩评论