I have an app which runs fine as a simple WPF app having an event handler on GotFocus at the main window level like so :
private void MainWindowGotFocus(object sender, RoutedEventArgs e)
{
var element = FocusManager.GetFocusedElement(this) as FrameworkElement;
if (element != null)
{
//...
However this behaves strangely when set as a XBAP app (almost exactly the same code - the main visual element is Page and not Window but the event is still available and triggered).
In that case (XBAP/wpf browser application) element is always null.
Any ideas? :(