Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

should I use RoutedEventHandler

What's the difference between this two:

_btnAddNew.Click += OnAddNewClick;

 _btnAddNew.Click += new RoutedEventHandler(OnAddNewClick);

Thank you!!

like image 645
Frank Avatar asked Oct 17 '10 07:10

Frank


1 Answers

There is no difference ... the first is a shortcut for the second.

In fact, if you try both ways, then use Reflector to disassemble the assembly, you can see that it's exactly the same and both are interpreted as:

_btnAddNew.Click += new RoutedEventHandler(OnAddNewClick);
like image 92
Richard Anthony Freeman-Hein Avatar answered Oct 02 '22 17:10

Richard Anthony Freeman-Hein