Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's a good implementation of weak events for silverlight?

I'm after a good implementation of the weak event patterns for Silverlight to avoid memory leaks. There seem to be a few implementations out there but the code is not trivial and it's hard to know which one is correct. I can't find any official recommendation from Microsoft.

I'm after a simple syntax if possible.

Cheers.

like image 414
Clement Avatar asked Oct 10 '22 11:10

Clement


1 Answers

Install a copy of the Silverlight Toolkit which comes with source code zipped up. In there you will find the pattern of weak events that you might consider the "Microsoft" recommendation. (You can also fetch the latest source from codeplex).

The implementation you are after is WeakEventListener found in the Common folder of he main Controls.Toolkit project.

like image 150
AnthonyWJones Avatar answered Oct 18 '22 21:10

AnthonyWJones