如何从浏览器外的 Silverlight 打开弹出窗口?
我需要从 Silverlight 浏览器外应用程序打开弹出窗口。
我在 Index.html 中添加了参数 ,但从代码后面执行此操作:
HtmlPage.Window.Navigate(new Uri(myUrl), "_blank", myFeatures);
仍然返回错误:
Silverlight OOB Error: The DOM/scripting bridge is disabled.
我已阅读有关 < a href="https://stackoverflow.com/questions/2677536/silverlight-4-oob-application-access-html-dom-of-the-page-in-webbrowser-control/2708194#2708194">这个帖子,这是否意味着我无法从OOB打开弹出窗口?为什么我需要这样做,因为实际上我已经通过 ChildWindow
中的 WebBrowser
控件在 OOB Silverlight 中显示了 HTML 页面,但是当我单击 HTML 页面中的锚点时,链接到_blank页面,它跳转到我的默认浏览器。它不满足要求,除了第一次也在默认浏览器中启动 HTML 索引页面,由 OOB Silverlight 中的按钮控件触发。这可能吗?
请指教,谢谢。
I need to open window pop-up from Silverlight Out-of-Browser application.
I've added parameter <param name="enablehtmlaccess" value="true" />
in Index.html, but executing this from code behind:
HtmlPage.Window.Navigate(new Uri(myUrl), "_blank", myFeatures);
still returns error:
Silverlight OOB Error: The DOM/scripting bridge is disabled.
I've read about this post, does it mean that I can't open pop-up from OOB? Why I need to do this, because actually I've shown the HTML page in OOB Silverlight by WebBrowser
control within ChildWindow
but when I click an anchor in HTML page, which linked to _blank page, it jumps to my default browser. It doesn't meet the requirement, except launch that HTML index page also in default browser at the first time, triggered from button control in OOB Silverlight. Is that possible?
Please advice, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不确定这是否是您想要的,但尝试一下...
在 OOB 应用程序中,您可以使用以下解决方法:
创建一个派生的超链接按钮,如下所示:
使用该按钮进行导航:
参见 forums.silverlight.net
not sure if this is what you are after, but try this...
In an OOB app, you can use the following work around:
Create a derived hyperlink button like this:
Use that for navigation:
see forums.silverlight.net
不,这是不可能的。在 OOB 应用程序中,与 HTML 桥的任何交互都被禁用。
No this is not possible. In an OOB application, any interaction with the HTML bridge is disabled.
我今天遇到了这个问题,这就是我在 SilverLight 5 中解决它的方法:使用以下代码创建一个新类
:使用它:
I came across this problem today and this is how I solved it in SilverLight 5: Create a new class with the following code:
Here's how to both implement & use it: