浏览器中的 Silverlight 通知 API
我想使用通知 API 为旨在在浏览器内外运行的 Silverlight 应用程序创建 toast 通知,但是 NotificationWindow 类 仅适用于 OOB。
是否有任何东西可以复制应用程序内的行为?我的想法是在屏幕右下角有一个容器覆盖所有其他内容。然后,创建一个检测 OOB 模式的包装器,如果可能,将参数传递给通知 API,或者如果没有,则填充并显示我自己的容器。有什么东西可以做到这一点吗?
微软选择不实现这样的东西似乎很奇怪, 正如之前指出的。
I'd like to use the Notification API to create toast notifications for a Silverlight app designed to run both in and out of the browser, but the NotificationWindow class is only available OOB.
Does there exist anything that can replicate the behaviour inside the app? My idea is to have a container in the bottom right of the screen overlaying all other content. Then, create a wrapper which detects OOB-mode, passing params to the Notification API if possible, or populating and showing my own container if not. Is there anything that does this available?
It seems strange that MS chose not to implement something like this, as has been pointed out before.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在浏览器中显示通知很简单。您只需使用弹出窗口并使其出现在正确的位置即可。请参阅以下帖子作为示例。
现在与该方法的区别在于通知将显示在浏览器内。在 OOB 中,它显示在窗口外部,即使窗口最小化,它也是可见的。由于安全原因,不可能直接执行此操作。
出于兴趣,Tweetdeck 和 Gmail 等 Chrome 应用程序能够在浏览器外部显示通知。我认为这可能是一种可能性,但不完全是 Silverlight 和跨浏览器解决方案。
Displaying a notification in browser is simple. You just need to use a popup and make it appear in the right place. See the following post as an example.
Now the difference with that approach is that the notification will show inside the browser. In OOB it shows outside the window and it's visible even if the windows is minimized. Due to security reasons it's not possible to directly do this.
Out of interest, Chrome Applications like Tweetdeck and Gmail, are able to display notifications outside of the browser. I think this might be a possiblity, but not exactly a Silverlight and cross browser solution.