Prior to .Net 4.5, WPF controls used to leak in user implementations ICommandthat did not use the weak event pattern because they did not unsubscribe from the CanExecuteChangedinterface event .
Now we have a class CanExecuteChangedEventManager, and a quick search JustDecompile discovers that clans are of type MenuItemand ButtonBaseuse a dispatcher, thereby avoiding leakage.
Is there a need to use a weak event pattern when creating a custom one ICommand?
source
share