NotifyEventHandler 대리자

정의

ScriptNotify 이벤트를 처리할 메서드를 나타냅니다.

public delegate void NotifyEventHandler(Platform::Object ^ sender, NotifyEventArgs ^ e);
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(3271414264, 28933, 19060, 161, 9, 222, 41, 223, 245, 107, 152)]
class NotifyEventHandler : MulticastDelegate
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(3271414264, 28933, 19060, 161, 9, 222, 41, 223, 245, 107, 152)]
public delegate void NotifyEventHandler(object sender, NotifyEventArgs e);
Public Delegate Sub NotifyEventHandler(sender As Object, e As NotifyEventArgs)

매개 변수

sender
Object

Platform::Object

IInspectable

처리기가 연결된 개체입니다.

e
NotifyEventArgs

이벤트에 대한 이벤트 데이터입니다.

특성

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

예제

다음 코드 예제에서는 Windows 8용으로 컴파일된 앱에서 ScriptNotify 이벤트를 사용하는 방법을 보여 줍니다. Windows 8.1 시작해서 AllowedScriptNotifyUris와 관련된 줄을 생략합니다. 자세한 내용은 WebView 클래스 개요를 참조하세요.

public MyPage()
{
    this.InitializeComponent();
    MyWebView.ScriptNotify += MyWebView_ScriptNotify;

    // Here we have to set the AllowedScriptNotifyUri property because we are 
    // navigating to some site where we don't own the content and we want to 
    // allow window.external.notify() to pass data back to the app.
    List<Uri> allowedUris = new List<Uri>();
    allowedUris.Add(new Uri("http://www.bing.com"));
    MyWebView.AllowedScriptNotifyUris = allowedUris;
}

void MyWebView_ScriptNotify(object sender, NotifyEventArgs e)
{
    // Respond to the script notification.
}

적용 대상