Is debugging a control's click handler possible?
Here's my code:
void Main()
{
var button = new Button("My Button").Dump("");
button.Click += HandleClick;
}
void HandleClick(object sender, EventArgs args)
{
// Stuff happens here
}
Breakpoints placed within the HandleClick method never cause execution to pause. Is that a limitation, or am I doing something wrong?
Thanks!
Answers
-
This happens because the script finishes running. Add the following line of code to the end of your Main method:
Util.KeepRunning();
-
Ah, fantastic, thank you!
