DesktopWindowXamlSource.GotFocus DesktopWindowXamlSource.GotFocus DesktopWindowXamlSource.GotFocus DesktopWindowXamlSource.GotFocus Event

Definition

Occurs when the DesktopWindowXamlSource gets focus in the desktop application (for example, the user presses the Tab key while focus is on the element just before the DesktopWindowXamlSource).

public : event TypedEventHandler<DesktopWindowXamlSource, DesktopWindowXamlSourceGotFocusEventArgs> GotFocus
// Register
event_token GotFocus(TypedEventHandler<DesktopWindowXamlSource, DesktopWindowXamlSourceGotFocusEventArgs> const& handler) const;

// Revoke with event_token
void GotFocus(event_token const& cookie) const;

// Revoke with event_revoker
GotFocus_revoker GotFocus(auto_revoke_t, TypedEventHandler<DesktopWindowXamlSource, DesktopWindowXamlSourceGotFocusEventArgs> const& handler) const;
public event TypedEventHandler<DesktopWindowXamlSource, DesktopWindowXamlSourceGotFocusEventArgs> GotFocus
Public Event GotFocus As TypedEventHandler (Of DesktopWindowXamlSource, DesktopWindowXamlSourceGotFocusEventArgs)

Remarks

When you add a DesktopWindowXamlSource to your desktop application, by default the DesktopWindowXamlSource does not automatically handle focus navigation via keyboard events such as the Tab or arrow keys. Call the NavigateFocus method to programmatically give focus when the user navigates to the DesktopWindowXamlSource.

Handle GotFocus event to be notified when user enters the DesktopWindowXamlSource via some non-keyboard event, such as a mouse click, and you want to keep the state of the UI in the host desktop application up to date.