Overview
- Defines the arguments to pass in an event.
- The EventArgs class is used to raise an event without any data.
- Derive from EventArgs when you need to pass custom data, demonstrated below.
Good practice
- Always use a class to pass event data via a delegate instead of defining separate parameters for each piece of event data.
Examples
Custom Event Arguments
public class MyEventArgs : EventArgs
{
private string _someData;
public MyEventArgs(string someEventData)
{
this._someData = someEventData;
}
}
You May Also Like

Exam 70-536 Study Notes
My study notes for Microsoft exam 70-536: .NET types, collections, generics, I/O, serialization and more, with C# examples.

Starting Exam 70-536 Study
After a burnout, I'm putting my own project on hold to study for Microsoft exam 70-536.

Design Patterns - Proxy Pattern
The Proxy Pattern, and the last article in the design patterns series, now that I've finished reading Head First Design Patterns.




