NotifyEventArgs 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供 ScriptNotify 事件的資料。
public ref class NotifyEventArgs sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class NotifyEventArgs final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class NotifyEventArgs final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class NotifyEventArgs
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class NotifyEventArgs
Public NotInheritable Class 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.
}
屬性
CallingUri |
取得頁面的統一資源識別項 (URI) ,其中包含引發 ScriptNotify 事件的腳本。 |
Value |
取得傳遞至應用程式的方法名稱。 |