我有一个承载控件的 ListBox。我希望能够从一个控件切换到下一行的控件。在我点击选项卡后,隐式生成的 ListBoxItem 似乎正在获得焦点。我怎样才能解决这个问题?
<ListBox ItemsSource="{Binding UiControls}"
DockPanel.Dock="Top"
BorderThickness="0"
Background="{DynamicResource ControlInteriorBrush}"
KeyboardNavigation.TabNavigation="Continue"
KeyboardNavigation.ControlTabNavigation="Continue">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="col1"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="col2"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="col3"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0">
<TextBlock Text="{Binding Path=Label}"
FontWeight="Bold"
VerticalAlignment="Center"
Background="{DynamicResource ControlInteriorBrush}"
Foreground="{DynamicResource FontBrush}"
Margin="0,0,25,0"
KeyboardNavigation.TabNavigation="Continue"/>
</Border>
<Controls:AutoCompleteTextBox Default="{Binding Path=DefaultValue}"
Items="{Binding Path=DropDownValues}"
Tag="{Binding}"
DataContext="{Binding}"
Width="300"
Grid.Column="1"
Height="30"
Background="{DynamicResource ControlInteriorBrush}"
Margin="0,0,10,0"
KeyboardNavigation.IsTabStop="True"
FocusManager.IsFocusScope="True"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>