What are Delegates in C#

Поделиться
HTML-код
  • Опубликовано: 11 июл 2022
  • A delegate is a type that represents references to methods with a particular parameter list and return type. Delegates are used to pass methods as arguments to other methods. Event handlers are nothing more than methods that are invoked through delegates.

Комментарии • 4

  • @rubayatislam4804
    @rubayatislam4804 Год назад

    Was excited with command and ICommand explanation from this channel, but this video certainly does not do justice. This video just made me more confused about the delegates topic.

    • @TacticDevs
      @TacticDevs  Год назад +2

      think of a delegate as a place holder for a method , a delegate is used in a place where you would expect a method , That method can be defined elsewhere but must follow the rules specified by the delegate, these rules dictate the return type and the parameters of that method .net allows you to create your custom delegates or use built-in delegates
      , check out this video about the built-in delegates in .net ruclips.net/video/LlZpno4_ylw/видео.html

    • @rubayatislam4804
      @rubayatislam4804 Год назад +1

      @@TacticDevs It would be great if you could provide coding examples like you did for ICommands.

    • @TacticDevs
      @TacticDevs  Год назад +1

      @@rubayatislam4804 sure thing