开发者

How do you set the border width style of listview items?

开发者 https://www.devze.com 2023-02-11 07:36 出处:网络
H开发者_如何学Cow can you set the border of list view items thanks.You can set your border in the ControlTemplate, something like below:

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}" />
0

精彩评论

暂无评论...
验证码 换一张
取 消