I have the following code attaching event handler:
this.btnOK.Click += (s,e) => { MessageBox.Show("test"); };
Can I unsubscribe that lambda expression from the vent?
Why don't just save the assigned lambda?
EventHandler lambda = (s,e) => { MessageBox.Show("test"); };
...
this.btnOK.Click += lambda;
...
this.btnOK.Click -= lambda;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With