Reputation: 185
i have this code :
button.Click += clickFunction();
private void clickFunction(object sender, RoutedEventArgs e)
{
// do something
}
I am pretty sure it should work, i've done this few times, it is usually how button.Click works. But this time, i have an error which say that i can't put a void function in a button.Click. It says i should use a RoutedEventHandler.
Am i not supposed to be able to use a void function? What is a RoutedEventHandler?
Thanks
Upvotes: 1
Views: 665