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

后端 未结 3 1408
执念已碎
执念已碎 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:11

    Use BorderThickness="1,0,1,1" and a DataTrigger which checks for RelativeSource={RelativeSource Mode=PreviousData} being null to set BorderThickness="1,1,1,1":

    
      
        
          Alice
          Bob
          Colleen
        
        
          
            
          
          
            
              
            
          
        
      
      
        
      
    
    

提交回复
热议问题