I can define an event like this(declared function):
MyElement.Keyup +=MyDeclaredFunction
I can also define it like this(anonymous delegate):
MyElement.Keyup+=new delegate(object sender, eventargs e) {};
I can also define it like this(lambda):
MyElement.Keyup += (sender, e) => myfunction
What is the best way to do this? One case the code for the event is found with the declaration of the event... in the other they are seperated.
I prefer method 1
can anyone tell me what the pros and cons of each method might be?