ListView with GridView selected row - remove 3D appearance

后端 未结 1 1596
南笙
南笙 2021-01-06 23:45

I have a WPF ListView that contains a GridView. I want the selected row to look \"flat\" and not 3d style.

Dose anyone know how to do this? Thanks, Smadar

1条回答
  •  醉酒成梦
    2021-01-07 00:31

    The 3D look is part of the default style. To change this you need to replace the ControlTemplate for ListViewItem. Here's a simple example which produces the following: ListView screenshot

    
        
            
                
                    
                        
                    
                
                
                    
                    
                    
                
    
                
                    
                
            
        
    
    

    Note: The default templates are located here http://msdn.microsoft.com/en-us/library/ms788747.aspx. Since there is no way to change part of a ControlTemplate or base one off of an existing template, I usually try to keep as much of the default template as I can, and only change the parts I care about. It's a little verbose but should do what you're looking for.

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