How do I access JavaScript this from ScriptSharp?
问题 I'm trying to do the following. var handler = e => { handle(); item.Unbind("event", this); } item.Bind("event", handler); In JavaScript this would properly work, but ScriptSharp replaces JavaScript's this with reference to the instance of class containing method with that code. How do I avoid this behavior and get a reference to the lambda from the lambda itself? 回答1: Here's how you could do it (assuming Bind takes a delegate with the signature of an Action): SomeObject item = ...; Action