[noesis:MoveFocusAction] Direction="Down" doesn't work properly with KeyboardNavigation.TabNavigation="Cycle"
Hi! I found that the focus with Direction="Down" does not shift from the last element to the first when KeyboardNavigation.TabNavigation="Cycle" is enabled.
With Direction="Up" this problem does not occur, the focus moves smoothly from the first element to the last.
Here is a minimal example to reproduce this problem:
With Direction="Up" this problem does not occur, the focus moves smoothly from the first element to the last.
Here is a minimal example to reproduce this problem:
Code: Select all
<Page x:Name="Test"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions">
<StackPanel Orientation="Horizontal">
<ListView x:Name="TheListView1" SelectionMode="Single" KeyboardNavigation.TabNavigation="Cycle">
<b:Interaction.Triggers>
<b:KeyTrigger Key="D1">
<noesis:MoveFocusAction Direction="Down" />
</b:KeyTrigger>
</b:Interaction.Triggers>
<ListViewItem>Element 1</ListViewItem>
<ListViewItem>Element 2</ListViewItem>
<ListViewItem>Element 3</ListViewItem>
<ListViewItem>Element 4</ListViewItem>
</ListView>
</StackPanel>
</Page>-
-
sfernandez
Site Admin
- Posts: 3364
- Joined:
Re: [noesis:MoveFocusAction] Direction="Down" doesn't work properly with KeyboardNavigation.TabNavigation="Cycle"
Directional navigation is configured by the KeyboardNavigation.DirectionalNavigation property, so you have to set that first.
And the second problem is that your ListView is focusable, so it is focusing it after reaching the top or the bottom of the list.
Could you please try the following instead:
And the second problem is that your ListView is focusable, so it is focusing it after reaching the top or the bottom of the list.
Could you please try the following instead:
Code: Select all
<ListView x:Name="TheListView1" SelectionMode="Single" KeyboardNavigation.DirectionalNavigation="Cycle" Focusable="False">Who is online
Users browsing this forum: schragnasher and 4 guests