title: Is it possible to change the Target of an Action at runtime in C#?
body: <p>I am trying to do something similar to javascript's function.bind() in c#.  </p>
  
  <p>I have an action:</p>
  
  <pre><code>var action = new Action(()=&gt;{this.SomeProperty = 123;});
  </code></pre>
  
  <p>At runtime, I want to execute the action in a different closure so the instance "this" is a dynamic object.</p>
  
  <p>something like this: </p>
  
  <pre><code>var action = new Action(()=&gt;{this.SomeProperty = 123;});
  
  dynamic myDynamic = new ExpandoObject();
  myDynamic.SomeProperty=321;
  
  action.Bind(myDynamic); &lt;--Of course this does not work...
  
  action.DynamicInvoke();
  
  Console.WriteLine(myDynamic.SomeProperty); //Should write 123...
  </code></pre>
  
  <p>I am starting to think this is not possible given what I am learning about how the runtime works in regard to lambdas and dynamics.. Perhaps there is some way using reflection?</p>
  
  <p>Thanks
  Lance</p>
  
  <p>Any advice is greatly appreciated.</p>