Why *should* we use EventHandler

后端 未结 6 887
无人及你
无人及你 2021-02-01 14:26

I hate EventHandler. I hate that I have to cast the sender if I want to do anything with it. I hate that I have to make a new class inheriting from EventArgs<

6条回答
  •  不知归路
    2021-02-01 15:02

    I commonly use Action<...> types as event handlers - if you don't need to interop with other code (or a designer) that specifically requires EventHandler, there's no reason to use it.

提交回复
热议问题