ListView Selected Item Style Override

前端 未结 1 1572
遇见更好的自我
遇见更好的自我 2020-12-21 13:25

I have a WPF ListView that I\'m trying to apply a custom style too... primarily I want to make the background of the listview box transparent with no border... and I want to

1条回答
  •  [愿得一人]
    2020-12-21 14:19

    This approach of trying to override the system colours doesn't work on Windows 8 and later.

    You need to modify the ControlTemplate of the ListViewItem container.

    You can copy the default template into your XAML markup by right-clicking on the ListView in design mode in Visual Studio or in Blend and choose Edit Additional Templates->Edit Generated Item Container (ItemContainerStyle) and then edit it as per your requirements by for example changing the Color properties of the SolidColorBrushes:

    
        
            
            
            
            
            
            
            
            
        
        
            
                
                    
                
            
        
    
    

    0 讨论(0)
提交回复
热议问题