有没有办法找出在我的可视树中哪个控件拥有焦点?这主要是用于调试。
就像这样
bool FocusedElement = FocusManager.GetFocusedElement() == textBox;
使用FocusManager
FocusManager.GetFocusedElement()
FocusManager.GetFocusedElement(this)