In the XAML below, the first toolbar (Toolbar1 below) does not lose focus and traverses all elements even with KeyboardNavigation.TabNavigation="Once" set. The only way I have make it work is by putting all elements of the toolbar into another container such as stack panel or grid (Toolbar2 below). However, then overflow functionality does not work appropriately. When width is reduced, whole inside container overflows instead of individual items.
My requirement is to tab out from the toolbar after first element (for remaining items user will use the arrow keys) without losing the overflow functionality of overflowing individual items as needed.
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="600" Width="525">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="50" />
<RowDefinition Height="100" />
<RowDefinition Height="50" />
<RowDefinition Height="100" />
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<TextBox Grid.Row="0" Text="First" Width="600"></TextBox>
<TextBox Grid.Row="1" Text="Second" Width="600"></TextBox>
<DockPanel LastChildFill="True" Grid.Row="2" Background="Red" >
<ToolBar x:Name="Toolbar1" DockPanel.Dock="Top"
VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="40" BandIndex="1" Band="1"
KeyboardNavigation.TabNavigation="Once" >
<Button Background="Red" Content="1" Height="28" Width="28" ToolBar.OverflowMode="AsNeeded" />
<Button Background="Red" Content="2" Height="28" Width="28" ToolBar.OverflowMode="AsNeeded" />
<Button Background="Red" Content="3" Height="28" Width="28" ToolBar.OverflowMode="AsNeeded" />
<Button Background="Red" Content="4" Height="28" Width="28" ToolBar.OverflowMode="AsNeeded" />
<Button Background="Red" Content="5" Height="28" Width="28" ToolBar.OverflowMode="AsNeeded" />
</ToolBar>
<TextBox DockPanel.Dock="Bottom" Text="I'm first Rich Text Box, My toolbar is not in a inner container." Height="50" Width="600"></TextBox>
</DockPanel>
<TextBox Grid.Row="3" Text="Third" Width="600"></TextBox>
<DockPanel LastChildFill="True" Grid.Row="4" Background="Green">
<ToolBar x:Name="Toolbar2" DockPanel.Dock="Top"
VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="40" BandIndex="1" Band="1"
KeyboardNavigation.TabNavigation="Once" >
<StackPanel Orientation="Horizontal" KeyboardNavigation.TabNavigation="Once" >
<Button Background="Green" Content="1" Height="28" Width="28" ToolBar.OverflowMode="AsNeeded" />
<Button Background="Green" Content="2" Height="28" Width="28" ToolBar.OverflowMode="AsNeeded"/>
<Button Background="Green" Content="3" Height="28" Width="28" ToolBar.OverflowMode="AsNeeded"/>
<Button Background="Green" Content="4" Height="28" Width="28" ToolBar.OverflowMode="AsNeeded"/>
<Button Background="Green" Content="5" Height="28" Width="28" ToolBar.OverflowMode="AsNeeded"/>
</StackPanel>
</ToolBar>
<TextBox DockPanel.Dock="Bottom" Text="I'm second Rich Text Box, My toolbar is in a inner container." Height="50" Width="600"></TextBox>
</DockPanel>
<TextBox Grid.Row="5" Text="Fourth" Width="600"></TextBox>
</Grid>