Does routed events in WPF store strong reference to the handler that is attached to them?
+1
A:
Hello,
If the control author implemented the WeakEvent pattern then yes. I believe the stock controls use this pattern.
UPDATE: They in fact do NOT. Here is a reference on this and other potential performance problems:
http://msdn.microsoft.com/en-us/library/aa970683(VS.85).aspx
Here is a reference on weak events:
http://msdn.microsoft.com/en-us/library/aa970850.aspx
HTH
Colby Africa
Colby Africa
2008-12-22 16:07:12
The standard controls did not implement weak event pattern.
ligaz
2008-12-22 16:10:15
Oh my... I didn't know that either. I assumed, which is never smart. I just did a bunch of reading on this. Here is a good reference for you on this and other potential performance issues:http://msdn.microsoft.com/en-us/library/aa970683(VS.85).aspxI apologize for the last post.
Colby Africa
2008-12-22 16:21:40