How to avoid memory leak using INotifyPropertyChanged interface?

It is not clear to me how the WPF DataBinding is decoupled from the PropertyChanged event of an object that implements the INotifyProprtyChanged interface. Otherwise, the binding source contains a reference to the control and is not freed.

Am I responsible for clearing all view bindings to allow the GC to clear it or is this somehow automated?


source to share

1 answer

WPF uses a weak event pattern to solve this problem. So no, you don't have to manually release the bindings. This will be done after your Control has been unloaded.



All Articles