Are routed events weak in WPF
Asked Answered
A

1

6

Does routed events in WPF store strong reference to the handler that is attached to them?

Acquainted answered 22/12, 2008 at 16:1 Comment(0)
U
3

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:

Optimizing WPF Application Performance

Here is a reference on weak events:

Weak Event Patterns

HTH

Colby Africa

Upswell answered 22/12, 2008 at 16:7 Comment(2)
The standard controls did not implement weak event pattern.Acquainted
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: msdn.microsoft.com/en-us/library/aa970683(VS.85).aspx I apologize for the last post.Upswell

© 2022 - 2024 — McMap. All rights reserved.