Share via


InputFocusController.NavigateFocusRequested Event

Definition

Occurs when the Content.ContentIsland host wants the ContentIsland to take focus.

For example, the user has tabbed through the elements of the host and now needs to tab into the ContentIsland. The hosting application calls InputFocusNavigationHost.NavigateFocus(Microsoft.UI.Input.FocusNavigationRequest) on the InputFocusNavigationHost associated with the SiteBridge. The InputFocusController for the ContentIsland then receives this NavigateFocusRequested event and can decide if it will take focus.

// 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) 

Event Type

Remarks

Setting the result value of the FocusNavigationRequestEventArgs does not implicitly set focus. TrySetFocus must be called explicitly.

Applies to