In a List I store several items with a header and sub items
_categories = new List<Category>();
Category cOne = new Category() { Header = "Category one" };
cOne.AddItem("Sub One");
cOne.AddItem("Sub Two");
cOne.AddItem("Sub Three");
_categories.Add(cOne);
In WPF I bind these items to a ListBox.
<ListBox x:Name="listbox">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Header}" />
<ListBox ItemsSource="{Binding Subs}" Padding="10 0 0 0" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
What I now try but fail is to make only the items in the inner ListBox click-able, i.e. to avoid:

If I set TextBlock.IsEnabled or TextBlock.IsHitTestVisible to false nothing changes. If the StackPanel's properties are set to false the inner ListBox isn’t click-able any more but interestingly the TextBlock still is. And the outer ListBox's properties prevents to click anything at all.
The behavior is identical if the outer ListBox is a ListView instead.
I haven’t figured out yet what I need to change to make sure that only the items in the inner list are enabled. Any ideas?
If there is no need to select the items in the outer
ListBoxwhatsoever, do not use aListBox– use anItemsControlinstead: