Good time, I ran into the problem of associating an anonymous event handler with a WPF element.

myImage.AddHandler(MouseLeftButtonDownEvent, Sub (o, e) anotherMethod(5) End Sub) 

But at runtime, I get the exception "Handler type mismatch" What am I doing wrong?

    1 answer 1

    I looked on the Internet, stumbled upon this kind of binding handler

     AddHandler Button1.Click, Sub(sender, e) Button1.content = "hallo" End Sub