InputFocusController.NavigateFocusRequested 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當 Content.ContentIsland 主機想要 ContentIsland 取得焦點時發生。
例如,使用者已透過主機的元素進行索引標籤,而現在必須分頁至 ContentIsland。 裝載應用程式會在與 SiteBridge 相關聯的 InputFocusNavigationHost 上呼叫 InputFocusNavigationHost.NavigateFocus (Microsoft.UI.Input.FocusNavigationRequest) 。 ContentIsland 的 InputFocusController 接著會收到此 NavigateFocusRequested 事件,並可決定是否要取得焦點。
// Register
event_token NavigateFocusRequested(TypedEventHandler<InputFocusController, FocusNavigationRequestEventArgs const&> const& handler) const;
// Revoke with event_token
void NavigateFocusRequested(event_token const* cookie) const;
// Revoke with event_revoker
InputFocusController::NavigateFocusRequested_revoker NavigateFocusRequested(auto_revoke_t, TypedEventHandler<InputFocusController, FocusNavigationRequestEventArgs const&> const& handler) const;
public event TypedEventHandler<InputFocusController,FocusNavigationRequestEventArgs> NavigateFocusRequested;
function onNavigateFocusRequested(eventArgs) { /* Your code */ }
inputFocusController.addEventListener("navigatefocusrequested", onNavigateFocusRequested);
inputFocusController.removeEventListener("navigatefocusrequested", onNavigateFocusRequested);
- or -
inputFocusController.onnavigatefocusrequested = onNavigateFocusRequested;
Public Custom Event NavigateFocusRequested As TypedEventHandler(Of InputFocusController, FocusNavigationRequestEventArgs)
事件類型
備註
設定 FocusNavigationRequestEventArgs 的結果值並不會隱含地設定焦點。 TrySetFocus 必須明確呼叫。