C# Events without arguments. How do I handle them?

前端 未结 5 1353
无人及你
无人及你 2020-12-30 23:35

I\'m currently working on a menu system for a game and I have the standard hierarchy for screens and screen elements. (Screens contain some collection of screen elements). I

5条回答
  •  情书的邮戳
    2020-12-31 00:32

    Try:

    public event EventHandler Selected;
    

    then to call..

    Selected(null, EventArgs.Empty);
    

    This way it's the default event definition and you don't need to pass any information if you don't want to.

提交回复
热议问题