what are Events in Dotnet Framework
Events in Dotnet Framework
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
what are Events in Dotnet Framework
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
RinkiRank #188 · 12.9K reputationPosted Jun 2, 2025, 2:29 AM EDT
In the .NET Framework, events are a key part of the language's support for the observer design pattern, which allows objects to communicate in a publisher-subscriber model.
You can read more here - https://www.c-sharpcorner.com/UploadFile/vemuhemanth/events-in-net/
Sandhiya PriyaRank #26 · 43.2K reputationPosted Oct 27, 2025, 1:26 AM EDT
What are Events in .NET Framework?
In the .NET Framework, an Event is a way for one object (publisher) to notify other objects (subscribers) that something has happened.
It’s built on delegates, which define the method signature for event handlers.
In simple terms:An event is a notification triggered by an action (like a button click), and handled by methods (event handlers) that respond to it.
Example:
public event EventHandler MyEvent; void RaiseEvent() { MyEvent?.Invoke(this, EventArgs.Empty); }Key Points:
Events use delegates internally.
Publisher raises the event, subscribers handle it.
You can attach (
+=) or detach (-=) event handlers.Used widely in UI apps, services, and real-time notifications.
In short:
Events = Communication mechanism between objects ? when something happens, others get notified automatically.