From 1740cca8440a80afbc5b2ab20bb81ea1ed6db1f3 Mon Sep 17 00:00:00 2001 From: Benedikt Stebner Date: Fri, 2 Jun 2023 10:53:03 +0200 Subject: [PATCH] Fix RoutedCommand input element tracking --- src/AvaloniaEdit/RoutedCommand.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AvaloniaEdit/RoutedCommand.cs b/src/AvaloniaEdit/RoutedCommand.cs index daa24f8..7a204d7 100644 --- a/src/AvaloniaEdit/RoutedCommand.cs +++ b/src/AvaloniaEdit/RoutedCommand.cs @@ -50,7 +50,7 @@ namespace AvaloniaEdit private static void GotFocusEventHandler(Interactive control, GotFocusEventArgs args) { - _inputElement = control as IInputElement; + _inputElement = args.Source as IInputElement; } public static RoutedEvent CanExecuteEvent { get; } = RoutedEvent.Register(nameof(CanExecuteEvent), RoutingStrategies.Bubble, typeof(RoutedCommand));