Differences between route events and additional events

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.