NotifyEventHandler NotifyEventHandler NotifyEventHandler NotifyEventHandler Delegate


Represents the method that will handle the ScriptNotify event.

public : delegate void NotifyEventHandler(Platform::Object sender, NotifyEventArgs e)
struct NotifyEventHandler : winrt::Windows::Foundation::IUnknown
   NotifyEventHandler(std::nullptr_t = nullptr) noexcept;
   template <typename L> NotifyEventHandler(L lambda);
   template <typename F> NotifyEventHandler(F* function);
   template <typename O, typename M> NotifyEventHandler(O* object, M method);
   void operator()(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Controls::NotifyEventArgs const& e) const;
public delegate void NotifyEventHandler(Object sender, NotifyEventArgs e)
Public Delegate Sub NotifyEventHandler(sender As Object, e As NotifyEventArgs)


Object Object

The object where the handler is attached.

NotifyEventArgs NotifyEventArgs

Event data for the event.


Windows 10 requirements

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


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()
    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(""));
    MyWebView.AllowedScriptNotifyUris = allowedUris;

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