I’m trying to learn about events and I have a task to create EventArgs info classes, derived from EventArgs. I’m not sure what this means and how I should do?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Event arguments are made to deliver additional information about the event that fired, for instance a value that was changed or an item’s ID. The signature of event handlers contains a
senderandEventArgs.Since
EventArgsare pretty empty, you usually implement your own class:This is just a normal subclass like you would create everywhere else. If you do not need to pass more information, use
EventArgs.Empty(static field).