Directional Navigation Focus with TreeView and TreeViewItem
Posted: 14 Sep 2022, 21:49
Hello!
I am working on building out a TreeView control that is nested within a Grid that contains other items. When using directional navigation with a controller, I am able to move focus from the outer Grid items to the TreeViewItems, but once focus is on a TreeViewItem, it will not leave the TreeView and return to the outer Grid items. It directionally navigates multiple TreeViewItems correctly, but will not move focus outside of itself.
Given the below structure of code, I would expect directional navigation to work as follows: When focus starts on the Control, moving directionally downward once with the controller joystick would place focus on the top TreeViewItem (which is what happens), and then moving directionally upward once would place focus back on the Control.
I've tried explicitly setting "KeyboardNavigation.DirectionalNavigation=Continue" on the TreeView, but that didn't work. My TreeViewItems are essentially using the same structure as the Sample TreeView Selector found in the Gallery sample (https://github.com/Noesis/Tutorials/blo ... urces.xaml).
Is this expected TreeView behavior? Is there a property that needs to be set on the TreeView to allow directional navigation to move in and out of its bounds?
I am working on building out a TreeView control that is nested within a Grid that contains other items. When using directional navigation with a controller, I am able to move focus from the outer Grid items to the TreeViewItems, but once focus is on a TreeViewItem, it will not leave the TreeView and return to the outer Grid items. It directionally navigates multiple TreeViewItems correctly, but will not move focus outside of itself.
Given the below structure of code, I would expect directional navigation to work as follows: When focus starts on the Control, moving directionally downward once with the controller joystick would place focus on the top TreeViewItem (which is what happens), and then moving directionally upward once would place focus back on the Control.
Code: Select all
<Grid>
<Control/>
<TreeView>
<TreeViewItem/>
<TreeViewItem/>
</TreeView>
</Grid>
Is this expected TreeView behavior? Is there a property that needs to be set on the TreeView to allow directional navigation to move in and out of its bounds?