WebViewControl.LostFocus 이벤트

정의

WebViewControl이 포커스를 잃을 때 앱에 알릴 수 있습니다. WebViewControl 내부/외부를 클릭하거나 WebViewControl 또는 MoveFocus 메서드 호출이 아닌 창에서 SetFocus를 호출하는 앱과 같은 프로그래밍 방식 포커스 변경으로 시작할 수 있습니다.

// Register
event_token LostFocus(TypedEventHandler<WebViewControl, IInspectable const&> const& handler) const;

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

// Revoke with event_revoker
WebViewControl::LostFocus_revoker LostFocus(auto_revoke_t, TypedEventHandler<WebViewControl, IInspectable const&> const& handler) const;
public event TypedEventHandler<WebViewControl,object> LostFocus;
function onLostFocus(eventArgs) { /* Your code */ }
webViewControl.addEventListener("lostfocus", onLostFocus);
webViewControl.removeEventListener("lostfocus", onLostFocus);
- or -
webViewControl.onlostfocus = onLostFocus;
Public Custom Event LostFocus As TypedEventHandler(Of WebViewControl, Object) 

이벤트 유형

Windows 요구 사항

디바이스 패밀리
Windows 10, version 1809 (10.0.17763.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v7.0에서 도입되었습니다.)

예제

다음 C# 샘플에서는 WebViewControl과 함께 GotFocus 및 LostFocus를 사용하는 이벤트를 보여 줍니다.

WebViewControl webViewControl; 

void WebViewControlGotFocus(WebViewControl sender, IInspectable args) 
{ 
    AddFocusHighlightToElement(sender); 
} 

void WebViewControlLostFocus(WebViewControl sender, IInspectable args) 
{ 
    RemoveFocusHighlightFromElement(sender); 
} 

webViewControl.GotFocus += WebViewControlGotFocus; 
webViewControl.LostFocus += WebViewControlLostFocus

GotFocus 및 LostFocus 이벤트는 WebViewControl이 포커스를 받거나 잃을 때 앱에 알릴 수 있습니다. MoveFocus를 호출하거나 사용자가 WebViewControl 내부/외부를 클릭하기 때문일 수 있습니다.

적용 대상