What is the use of. NET Foundation EventArgs

Source: Internet
Author: User

Suddenly found that EventArgs is nothing to use, it is similar to ViewModel, just that this class is stored data, do not inherit EventArgs program can also run.

With this there is only one benefit, that is, no matter what eventargs we define, the method can be replaced with this parent class. Such as

public void Btn_click (EventArgs args)

{

}

Similarly, if we are to derive a ViewModel base class for ViewModel in MVC, then all methods that call this ViewModel can also be written as

public void Showmodel (Viewmodel model)

{

}

However, there is no egg to use, and it is necessary to make the parent class as our actual subclass before using the methods in this subclass. It's a chicken-like thing, and the only use of this is to unify the event parameters in the Webform,winform into EventArgs args.

What is the use of. NET Foundation EventArgs

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.