WebView2.HasFocusWithinCore Method

Definition

This is overridden from HwndHost and is called when WPF needs to know if the focus is in our control/window. WPF can't know on its own since we're hosting a non-WPF window, so instead it asks us by calling this. To answer, we just track state based on CoreWebView2 events that fire when it gains or loses focus.

C#
protected override bool HasFocusWithinCore ();

Returns

True if the focus is in our control/window, false if it isn't.

Applies to

Producto Versiones
WebView2 .NET 1.0.664.37, 1.0.705.50
WebView2 .NET Prerelease 0.9.515, 0.9.538, 0.9.579, 0.9.628, 1.0.674, 1.0.721