【问题标题】:WebView Control Metro Style AppWebView 控制 Metro 风格 App
【发布时间】:2012-10-10 12:50:29
【问题描述】:

如何在 Metro 风格应用程序的 webview 控件的源属性中发送带有 URL 的参数。

【问题讨论】:

标签: webview microsoft-metro


【解决方案1】:

您只需将它们添加到 URL。

 source="http://myurl/?param1=hello&param2=world"

【讨论】:

    【解决方案2】:

    或者也可以注入一个javascript文件与网页进行通信:

    Uri uri = new Uri("ms-appx:///js/script.js");
    StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(uri);
    string text = await FileIO.ReadTextAsync(file); //reading content as string
    var script = "(function(){" + text + "})()";
    

    【讨论】:

      猜你喜欢
      • 2012-09-30
      • 2012-10-16
      • 1970-01-01
      • 1970-01-01
      • 2011-11-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-28
      相关资源
      最近更新 更多