dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.29k stars 5.92k forks source link

Clearly distinguish between "subscribing to an existing event with an event handler" and "raising an event" #28033

Open zspitz opened 2 years ago

zspitz commented 2 years ago

As in much of OOP, there are two sides to events:

  1. class design -- declaring the event, and raising it within the class
  2. event consumption -- subscribing to the event

This article doesn't clearly differentiate between those two sides.

Specifically, the subheadings ("Call an event handler using Handles and WithEvents" and "Call an event handler using AddHandler") are confusing. How does subscribing to an event handler qualify as "calling" the event handler? And raising the event is in any case done using RaiseEvent.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

BillWagner commented 2 years ago

Thanks for raising this @zspitz

I've added it to our backlog to address.