Silverlight 2 中缺少 Unload 事件

发布于 2024-08-11 04:28:38 字数 55 浏览 3 评论 0原文

Silverlight 2 缺少 UserControl 的卸载事件。有人为此实施了解决方法吗?

Silverlight 2 is missing the unload event for a UserControl. Has anyone implemented a workaround for this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

千年*琉璃梦 2024-08-18 04:28:38

你可能想看看这里:
http://gallery.expression.microsoft.com/en-us/SLUnloadedBehavior

该代码适用于 SL 3,但如果删除行为代码,它应该适用于 Sl2

@KeithMahony

一种情况是您想要防止事件内存泄漏,这是大多数人倾向于忽略的 silverlight 开发的陷阱之一。

you might want to look here:
http://gallery.expression.microsoft.com/en-us/SLUnloadedBehavior

The code is for SL 3 but if you remove the behavior code it should work for Sl2

@KeithMahony

One scenario is that you want to prevent event memory leaks, one of the pitfalls of silverlight development that most people tend to ignore.

不羁少年 2024-08-18 04:28:38

我认为您会得到的最接近的是应用程序服务,它可以让您检测Silverlight何时应用程序正在关闭并对其做出响应。如果您使用的是导航应用程序,那么您可以挂钩父框架的导航事件来确定页面正在“卸载”。

您想要做什么需要 UserControl 响应卸载事件?

I think the closest you'll get is Application Services which let you detect when the Silverlight application is closing and respond to it. If you're using a Navigation application then you can hook into the Navigating event of the parent frame to determine that the page is "unloading".

What are you trying to do that requires a UserControl to respond to an unloading event?

甜是你 2024-08-18 04:28:38

考虑使用 Silverlight 4。我最后附带了一个 已卸载事件。

Consider using Silverlight 4. I comes with - at last - an Unloaded event.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文