-api-id | -api-type |
---|---|
M:Windows.UI.Xaml.Automation.Peers.AutomationPeer.HasKeyboardFocusCore |
winrt method |
Provides the peer's behavior when a Microsoft UI Automation client calls HasKeyboardFocus or an equivalent Microsoft UI Automation client API.
true if the element has keyboard focus; otherwise, false.
The standard implementation at the AutomationPeer level checks whether the owner has focus, and always returns false if the owner isn't focusable. FrameworkElementAutomationPeer expands this behavior somewhat because it adds awareness of owner characteristics that rely on the owner being a Control subclass. Test the existing return value in the peer that you are using or overriding and then override that behavior if necessary.
FrameworkElementAutomationPeer, Custom automation peers, Accessibility