I feel like this should be an easy question, but it doesn't seem to be.
I have a WPF TreeView which consists of buttons:
<TreeView ItemsSource="{Binding Categories}" Tag="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding ChildCategories}">
<Button
Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.ViewDocumentsCommand}"
CommandParameter="{Binding}"
Style="{DynamicResource TreeButton}"
Content="{Binding Description}" />
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
The Button Command loads data into another control on the WPF form. As soon as the user clicks on the content of that control, the button loses focus.However, I want the Button to retain the focussed style so the user is aware which was the last button they clicked.
I have tried noodling about with InactiveSelectionHighlightBrushKey but as far as I know, this isn't valid for a button. How else can I go about this?
EDIT: context was asked for. Effectively, I've used the TreeView to make a mini version of windows explorer. Each node corresponds to a folder, and you can use the expand/collapse button to show sub-folders. Create a sub-folder by right-clicking where you want it in the tree, via a ContextMenu. Click on the folder to see a list of files adjacent to the tree. Clicking on a file causes the folder to lose focus, so the user can't tell which "folder" they're in.