My TreeViewItem.Items data template contains 2 textboxes. When I press Tab key in first textbox, focus goes on second textbox. I want to when I press Tab on second textbox - focus going on first textbox on next TreeViewItem subitem and if there are TreeViewItem has not next subitem, focus goes on first subitem on next TreeViewItem. How to do that?
<TreeView Name="resultsTv"
ItemTemplate="{StaticResource excerciseResultDataTemplate}"
KeyboardNavigation.TabNavigation="Contained">
<TreeView.ItemContainerStyle>
<Style>
<Setter Property="TreeViewItem.IsExpanded" Value="True"/>
<Setter Property="KeyboardNavigation.TabNavigation" Value="Contained"></Setter>
</Style>
</TreeView.ItemContainerStyle>
</TreeView>
<HierarchicalDataTemplate x:Key="excerciseResultDataTemplate" ItemTemplate="{StaticResource setDataTemplate}" ItemsSource="{Binding Sets}">
<StackPanel Orientation="Horizontal" KeyboardNavigation.TabNavigation="Continue">
<Label Content="{Binding Name}"></Label>
</StackPanel>
</HierarchicalDataTemplate>
<DataTemplate x:Key="setDataTemplate">
<StackPanel Orientation="Horizontal" KeyboardNavigation.TabNavigation="Continue">
<TextBox Width="50" Text="{Binding Weight}"/>
<TextBox Width="50" Text="{Binding Repeats"/>
</StackPanel>
</DataTemplate>