private void FocusManager_GotFocus(object sender, FocusManagerGotFocusEventArgs e) { if (e.NewFocusedElement is FrameworkElement fe) { focused.Text = string.IsNullOrWhiteSpace(fe.Name) ? $"<unnamed {fe.GetType().Name}>" : fe.Name; } else { focused.Text = "<none>"; } }
private void FocusManager_GotFocus(object sender, FocusManagerGotFocusEventArgs e) { FocusOnControl(e.NewFocusedElement as FrameworkElement); }