In this code snippet, we will take a look at event arguments in C#.
Event arguments allow you to pass data(from publisher to subscriber) with the event when it is triggered. To return data with an event you must make a class that inherits from the EventArgs class. In this new derived class you can add the properties you want to send. Then you return this EventArgs child class with the event.
See this post if you want to know more about events themselves.
Let’s have a look at the code below to see how to use event arguments.