DependencyPropertyDescriptor leaking for a long time, because of this I had a lot of problems. Unless you explicitly name RemoveValueChanged , all of your components will be RemoveValueChanged . Internally, it supports the HashTable of EventHandler . Here is what he does:
if (this.valueChangedHandlers == null) this.valueChangedHandlers = new Hashtable(); EventHandler eventHandler = (EventHandler) this.valueChangedHandlers[component]; this.valueChangedHandlers[component] = (object) Delegate.Combine((Delegate) eventHandler, (Delegate) handler);
Because property descriptors are cached, all of your components will be embedded.
source share