How can I change the Background
of a selected TreeViewItem
when the TreeView
(or the Application) looses Focus. A selected item by def
More easy way for your particular case exists. Like in ListBox, you can replace ControlBrush resource for TreeViewItem's using style:
You can specify any other color. Opacity is suggested because if your have several TreeView/ListBox you can determine which one is focused. But of course, editing full style can bring you much more flexibility for future customizations.
Sample with gradients: