diff --git a/WPFTabTip/TabTipAutomation.cs b/WPFTabTip/TabTipAutomation.cs index 857212a..86e2400 100644 --- a/WPFTabTip/TabTipAutomation.cs +++ b/WPFTabTip/TabTipAutomation.cs @@ -105,6 +105,16 @@ public static void BindTo() where T : UIElement }), handledEventsToo: true); + EventManager.RegisterClassHandler( + classType: typeof(T), + routedEvent: UIElement.PreviewMouseDownEvent, + handler: new RoutedEventHandler((s, e) => + { + if (((UIElement)s).IsFocused) + FocusSubject.OnNext(new Tuple((UIElement)s, true)); + }), + handledEventsToo: true); + EventManager.RegisterClassHandler( classType: typeof(T), routedEvent: UIElement.GotFocusEvent,