Description | Having a ScrollViewer which contains an ItemsControl, trying to move the focus on the control that defines each item to select it is not working.
The following xaml reproduces the issue:
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid.Resources>
<GradientStopCollection x:Key="list">
<GradientStop Offset="0" Color="Red"/>
<GradientStop Offset="1" Color="Green"/>
<GradientStop Offset="2" Color="Blue"/>
</GradientStopCollection>
<DataTemplate x:Key="entry">
<Button Content="{Binding Offset}" Margin="0,10"/>
</DataTemplate>
</Grid.Resources>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" KeyboardNavigation.DirectionalNavigation="Contained">
<Button Content="Before" Margin="0,10"/>
<ScrollViewer Width="200" Height="200">
<ItemsControl ItemsSource="{StaticResource list}" ItemTemplate="{StaticResource entry}"/>
</ScrollViewer>
<Button Content="After" Margin="0,10"/>
</StackPanel>
</Grid> |
---|