I cannot get backwards navigation using Shift+Tab to work in a TreeView that contains TextBoxs, forward navigation using Tab works fine and jump from TextBox to TextBox insi
You don't have to use a custom class inherited from TreeView:
treeView.PreviewKeyDown += this.HandleTreeView_PreviewKeyDown
together with:
private void HandleTreeView_PreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Shift)
&& e.Key == Key.Tab)
{
var focusedElement = Keyboard.FocusedElement;
if (focusedElement != null)
{
focusedElement.MoveFocus(FocusNavigationDirection.Previous, 1);
}
e.Handled = true;
}
}
Also works fine.
With this solution you could, for example, create a custom behavior and attach it to your TreeView.