I'm going to focus hell right now in my WPF application. Focus is jumping around between elements, and seemingly disappearing only to come up on another element when the tab key is repeatedly pressed.
Is there a property I can bind a label on to or something that will simply just tell me what the heck the keyboard focus is latched on to at the time? Sometimes I can see the ant trail (dotted line) indicating something has focus, but I can't tell what it is surrounding to turn the keyboard focus off!
What you are likely looking for is:
(System.Windows.Input.Keyboard.FocusedElement as FrameworkElement).Name
You will have to setup a DependencyProperty for it so that you can bind to it though.
Vaccano
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With