开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜