NotifyEventHandler Delegar

Definição

Representa o método que manipulará o evento 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)

Parâmetros

sender
Object

Platform::Object

IInspectable

O objeto em que o manipulador está anexado.

e
NotifyEventArgs

Os dados de evento do evento.

Atributos

Requisitos do Windows

Família de dispositivos
Windows 10 (introduzida na 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduzida na v1.0)

Exemplos

O exemplo de código a seguir demonstra o uso do evento ScriptNotify em aplicativos compilados para Windows 8. Começando com Windows 8.1, omita as linhas relacionadas a AllowedScriptNotifyUris. Para obter mais informações, consulte a visão geral da classe 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.
}

Aplica-se a