Routing event:
Events are triggered and CLR events are handled by the host itself (this. raiseevent this. addhandler this. removehandler); The host consists of three parts: declaring and registering a route event (xxxevent), defining the CLR event wrapper (xxx {add, remove }) encapsulate the method (onfunction) that contains the code that triggers the routing event)
Additional event:
Events and CLR packaging (Registration and release) are all handled by the "target element" (that is, the element where the additional event is to be installed) (E. raiseevent E. addhandler E. removehandler); The host contains two parts: declare and register the route event (xxxevent), and define the CLR wrapper (two methods: addxxxhandler; removerxxxhandler), No Triggering Method encapsulation (put in the desired place, the specified uielement calls the raiseevent (newevent) method to trigger the event, where: newevent = new routedeventargs (xxxevent, source ))
Differences between route events and additional events