Reputation: 2292
Is there a way to figure out which control in my visualtree has focus? This is mostly for debugging.
Upvotes: 8
Views: 6946
Reputation: 11844
Like this
bool FocusedElement = FocusManager.GetFocusedElement() == textBox;
Use FocusManager
Upvotes: 23