Hi,
we have a problem with a shortcut from the TabbedMdiContainerTabControl.
The control changes the active document when the home or end key are pressed. This interfers with the navigation in other controls, which is why we disabled it. To do so, we handle the key event with a class handler in the application:
EventManager.RegisterClassHandler(typeof(AdvancedTabControl), UIElement.PreviewKeyDownEvent, new RoutedEventHandler(TabControlPreviewKeyDown));
private static void TabControlPreviewKeyDown(object sender, RoutedEventArgs e)
{
KeyEventArgs ke = (KeyEventArgs)e;
if (ke.Key == Key.Home || ke.Key == Key.End)
{
e.Handled = true;
}
}
However this causes side-effects in other parts, since the event is triggered, even if a tool window is focused and no document event exists. The property 'IsKeyboardFocusWithin' returns true even when a floating tool window is focused.
So, is there another way to disable the home and end key handling of the tab control?
Best regards, Tobias Lingemann.