views:

28

answers:

1

What's the difference between this two:

_btnAddNew.Click += OnAddNewClick;

 _btnAddNew.Click += new RoutedEventHandler(OnAddNewClick);

Thank you!!

+4  A: 

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);
Richard Hein
However the first is much more pleasant to read. :)
Vlad