Similar to C#, the += and -= operators are used to subscribe to events:
+=
-=
obj.Event += (s e) -> print "invoked"
To unsubscribe from an event later on, the exact same reference is needed. Therefore, it's best to save it into a local variable:
let handler : EventHandler = (s e) -> print "invoked" obj.Event += handler obj.DoSomeStuff () obj.Event -= handler
There was an error while loading. Please reload this page.