What's the difference between a class listener and an instance listener in WPF?

I am trying to wrap my head around some WPF specific stuff, and have yet to find the concrete relation between the UIElement.AddHandler method and the EventManager.RegisterClassHandler method.

I have googled a bit and found this interesting MSDN article:

http://msdn.microsoft.com/en-us/library/ms747183.aspx

Here it states:

"Routed events consider two different types of listeners to the event: class listeners and instance listeners. Class listeners exist because types have called a particular EventManager API, RegisterClassHandler, in their static constructor, or have overridden a class handler virtual method from an element base class. Instance listeners are particular class instances/elements where one or more handlers have been attached for that routed event by a call to AddHandler."

Alright now so I know the difference between a class and its instance, but somehow I cannot make sense out of this specific part of the document.

Can anyone clear that up for me?

8
задан Cœur 2 February 2019 в 05:56
поделиться