The Weak Event pattern
Events in C# are a powerful mechanism for decoupling components and enabling a publisher/subscriber model. However, they have a significant drawback: the publisher holds a strong reference to the subscriber, and this can cause memory leaks. This article describes a pattern for implementing weak events in C#.
https://steven-giesel.com/blogPost/675b75fc-2c1b-43da-9ff8-42962ca8159b
#weakevent #observer
Post #2297
384