开发者

Missing Unload event in Silverlight 2

开发者 https://www.devze.com 2022-12-11 10:42 出处:网络
Silverlight 2 is missing the unload event for a UserControl. Has anyone implemented a workaround f开发者_如何学Goor this?you might want to look here:

Silverlight 2 is missing the unload event for a UserControl. Has anyone implemented a workaround f开发者_如何学Goor this?


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.


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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消