I would like to have a property that is always bound to the current lumped control.
I saw two ways to get the current focused control.
One uses Keyboard.FocusedElement. The second is a visual tree.
Since I want to know every time a focused element changes, a visual tree walk seems to work a lot of code all the time.
But Keyboard.FocusedElement does not implement INotifyPropertyChanged. Therefore, I canβt just get attached to it normally.
Is there a way to get him to tell me when he will change?
(Or is there any other way to have a property that is always set for the current focused control?)
NOTE. . I can add an event to each control and update it. But I have a lot of control. I want not to apply an event to each of them.
source
share