DesktopWindowXamlSource.TakeFocusRequested 事件

定义

例如,当主机桌面应用程序收到从 DesktopWindowXamlSource 对象 (获取焦点的请求时发生,用户位于 DesktopWindowXamlSource 中的最后一个可聚焦元素上,然后按 Tab) 。

// Register
event_token TakeFocusRequested(TypedEventHandler<DesktopWindowXamlSource, DesktopWindowXamlSourceTakeFocusRequestedEventArgs const&> const& handler) const;

// Revoke with event_token
void TakeFocusRequested(event_token const* cookie) const;

// Revoke with event_revoker
DesktopWindowXamlSource::TakeFocusRequested_revoker TakeFocusRequested(auto_revoke_t, TypedEventHandler<DesktopWindowXamlSource, DesktopWindowXamlSourceTakeFocusRequestedEventArgs const&> const& handler) const;
public event TypedEventHandler<DesktopWindowXamlSource,DesktopWindowXamlSourceTakeFocusRequestedEventArgs> TakeFocusRequested;
function onTakeFocusRequested(eventArgs) { /* Your code */ }
desktopWindowXamlSource.addEventListener("takefocusrequested", onTakeFocusRequested);
desktopWindowXamlSource.removeEventListener("takefocusrequested", onTakeFocusRequested);
- or -
desktopWindowXamlSource.ontakefocusrequested = onTakeFocusRequested;
Public Custom Event TakeFocusRequested As TypedEventHandler(Of DesktopWindowXamlSource, DesktopWindowXamlSourceTakeFocusRequestedEventArgs) 

事件类型

注解

DesktopWindowXamlSource 添加到桌面应用程序时,默认情况下 ,DesktopWindowXamlSource 不会通过键盘事件(如 Tab 键或箭头键)自动处理焦点导航。 当用户离开 DesktopWindowXamlSource 时,处理此事件以编程方式将焦点分配给主机应用程序中的下一个可聚焦元素。

适用于