我们的 ListView 要求是列标题可以通过键盘访问,而默认 ListView 不会发生这种情况。例如:
<StackPanel x:Name="LayoutRoot">
<ListView HorizontalAlignment="Left" KeyboardNavigation.TabNavigation="Local">
<ListView.View>
<GridView >
<GridViewColumn Header="Header _1" KeyboardNavigation.TabIndex="0"/>
<GridViewColumn Header="Header _2" KeyboardNavigation.TabIndex="1"/>
<GridViewColumn Header="header _3" KeyboardNavigation.TabIndex="2"/>
</GridView>
</ListView.View>
<ListViewItem Content="I'm the first item" />
<ListViewItem Content="I'm the second item" />
</ListView>
<Button Content="I can also get focus" HorizontalAlignment="Left" Margin="0,27,0,0"/>
</StackPanel>
访问键显示标题,但它们没有获得键盘焦点。我通过阅读此问题添加的 TabIndex 和 TabNavigation: tabbing to TextBoxes in column headers
我需要做什么才能使 GridViewColumnHeaders 键盘可访问?