NotifyEventHandler NotifyEventHandler NotifyEventHandler NotifyEventHandler Delegate

Definition

Represents the method that will handle the ScriptNotify event.

public : delegate void NotifyEventHandler(Platform::Object sender, NotifyEventArgs e)
public delegate void NotifyEventHandler(Object sender, NotifyEventArgs e)
Public Delegate NotifyEventHandler(sender As Object, e As NotifyEventArgs)
var notifyEventHandler = function(sender, e) {

 /* Your code */

}
Parameters
sender
Platform::Object Object Object Object

The object where the handler is attached.

Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

The following code example demonstrates the use of the ScriptNotify event in apps compiled for Windows 8. Starting with Windows 8.1, omit the lines related to AllowedScriptNotifyUris. For more info, see the WebView class overview.

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.
}