If you switch to another window and then activate the window that uses AvalonDock again, the Keyboard.FocusedElement is null because no keyboard focus is set (Keyboard.DefaultRestoreFocusMode = RestoreFocusMode.None in DockingManager).
Steps to reproduce:
- Start AvalonDock.TestApp and select some text in Document1
- Switch with alt+tab to other window and then back to AvalonDock.TestApp
- The keyboard focus isn't set to Document1. Keyboard.FocusedElement is null.