Is it possible to emulate border-collapse (ala CSS) in a WPF ItemsControl?

后端 未结 3 1491
执念已碎
执念已碎 2021-02-13 11:28

I\'m styling the items in a WPF ListBox, and want to put a border around each item. With BorderThickness set to 1, for example, the top-bottom borders

3条回答
  •  半阙折子戏
    2021-02-13 12:08

    One thing that comes to mind is to make use of AlternationIndex. This will require you to set something like AlternationCount="10000" on the ListBox. After that you can set BorderThickess="1,0,1,1" and use a DataTrigger to find the first ListBoxItem

    
              
        
      
      
        
          
        
      
    
    

提交回复
热议问题