WPF TreeViewItem Background

后端 未结 3 975
难免孤独
难免孤独 2021-01-07 05:03

How can I change the Background of a selected TreeViewItem when the TreeView (or the Application) looses Focus. A selected item by def

3条回答
  •  温柔的废话
    2021-01-07 05:07

    If you don't want to override the default contol template, you can define your own template for the headers using textblock and apply the style in that template to the textblock itself (there's a small padding in the default control template of TreeViewItem, so you should also set it to zero to achieve pixel-perfection).

    
        
                        
                        
                    
                
            
        
    
    
    
        
        
        
        
    
    

提交回复
热议问题