Change WPF treeViewItem Background color when selected but lost focus

前端 未结 2 2161
独厮守ぢ
独厮守ぢ 2021-02-19 04:50

I am trying to change a TreeViewItem background color when it selected but lost focus. I saw some similar questions like: WPF TreeViewItem Background , but I couldn\'t use it...

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-19 04:57

    In reference to this other post, the ControlBrushKey did not work for me. The InactiveSelectionHighlightBrushKey did, however. Also setting the InactiveSelectionHighlightTextBrushKey got around the changing text color.

    My complete solution:

    
        
        
        
    
    

提交回复
热议问题