From c5608bd386ddfed5ba1cc27b43326f53a846dc98 Mon Sep 17 00:00:00 2001 From: sdoroff Date: Wed, 28 Feb 2018 20:10:35 -0500 Subject: [PATCH] Moved the setting of FocusedElement This allows the LostFocus event to check the newly focused element --- src/Avalonia.Input/KeyboardDevice.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Input/KeyboardDevice.cs b/src/Avalonia.Input/KeyboardDevice.cs index d815f8082b..2a1cdec1c0 100644 --- a/src/Avalonia.Input/KeyboardDevice.cs +++ b/src/Avalonia.Input/KeyboardDevice.cs @@ -46,13 +46,13 @@ namespace Avalonia.Input if (element != FocusedElement) { var interactive = FocusedElement as IInteractive; + FocusedElement = element; interactive?.RaiseEvent(new RoutedEventArgs { RoutedEvent = InputElement.LostFocusEvent, }); - FocusedElement = element; interactive = element as IInteractive; interactive?.RaiseEvent(new GotFocusEventArgs