title: MvvmCross bind to InteractionRequest
body: <p>I am attempting to implement a modal confirmation popup using mvvmcross in iOS, following the Stuart's outline in <a href="https://stackoverflow.com/questions/18609018/mvvmcross-dialog/18624500#18624500">this question</a>.  I get the following exception when attempting to bind the InteractionRequest to the Event handler:</p>
  
  <pre><code>Problem seen during binding execution for to ConfirmationInteraction - problem
  TargetInvocationException: Exception has been thrown by the target of an invocation.
  </code></pre>
  
  <p>The inner exception is:</p>
  
  <pre><code>ArgumentNullException: missing source event info in MvxWeakEventSubscription
  Parameter name: sourceEventInfo
  at Cirrious.CrossCore.WeakSubscription.MvxWeakEventSubscription`2[System.Object,System.EventArgs]..ctor (System.Object source, System.Reflection.EventInfo sourceEventInfo, System.EventHandler`1 targetEventHandler) [0x00000] in &lt;filename unknown&gt;:0 
  at Cirrious.CrossCore.WeakSubscription.MvxGeneralEventSubscription..ctor (System.Object source, System.Reflection.EventInfo eventInfo, System.EventHandler`1 eventHandler) [0x00000] in &lt;filename unknown&gt;:0 
  at Cirrious.CrossCore.WeakSubscription.MvxWeakSubscriptionExtensionMethods.WeakSubscribe (System.Reflection.EventInfo eventInfo, System.Object source, System.EventHandler`1 eventHandler) [0x00000] in &lt;filename unknown&gt;:0 
  </code></pre>
  
  <p>Most of the plumbing is identical to the referenced stack overflow question above, but I will post it here for completeness:</p>
  
  <pre><code>public class InteractionRequestedEventArgs : EventArgs
  {
      public Action Callback 
      { 
          get; 
          private set; 
      }
  
      public object Context 
      { 
          get; 
          private set; 
      }
  
      public InteractionRequestedEventArgs(object context, Action callback)
      {
          Context = context;
          Callback = callback;
      }
  }
  </code></pre>
  
  <p>The InteractionRequest:</p>
  
  <pre><code>public class InteractionRequest&lt;T&gt; : IInteractionRequest
  {
      public event EventHandler&lt;InteractionRequestedEventArgs&gt; Raised;
  
      public void Raise(T context, Action&lt;T&gt; callback)
      {
          var handler = this.Raised;
          if (handler != null)
          {
              handler(
                  this, 
                  new InteractionRequestedEventArgs(
                  context, 
                  () =&gt; callback(context)));
          }
      }
  }
  </code></pre>
  
  <p>The confirmation class:</p>
  
  <pre><code>public class Confirmation
  {
      public string Message { get; private set; }
      public bool Confirmed { get; set; }
      public Confirmation(string message)
      {
          Message = message;
      }
  }
  </code></pre>
  
  <p>In the view model we set up the request as so:</p>
  
  <pre><code>private InteractionRequest&lt;Confirmation&gt; _confirmCancelInteractionRequest = new InteractionRequest&lt;Confirmation&gt;();
      public IInteractionRequest ConfirmCancelInteractionRequest
      {
          get
          {
              return _confirmCancelInteractionRequest;
          }
      }
  </code></pre>
  
  <p>in the view we set up the event subscription:</p>
  
  <pre><code>    private MvxGeneralEventSubscription _confirmationSubscription;
      private IInteractionRequest _confirmationInteraction;
      public IInteractionRequest ConfirmationInteraction
      {
          get { 
              return _confirmationInteraction; 
          }
          set
          {
              if (_confirmationInteraction == value)
                  return;
              if (_confirmationSubscription != null)
                  _confirmationSubscription.Dispose();
              _confirmationInteraction = value;
              if (_confirmationInteraction != null)
                  _confirmationSubscription = _confirmationInteraction
                      .GetType ()
                      .GetEvent ("Raise")
                      .WeakSubscribe(_confirmationInteraction, DoConfirmation);
  
          }
      }
  </code></pre>
  
  <p>The event handler in the view looks like this:</p>
  
  <pre><code>private void DoConfirmation(object s, EventArgs args)
      {
          var iArgs = (InteractionRequestedEventArgs)args;
          var confirmation = (Confirmation)iArgs.Context;
  
          var alert = new UIAlertView(); 
          alert.Title = "Bazinga"; 
          alert.Message = confirmation.Message; 
  
          alert.AddButton("Yes"); 
          alert.AddButton("No"); 
  
          alert.Clicked += (sender, e) =&gt; { 
              var alertView = sender as UIAlertView; 
                              // do something with the event
              iArgs.Callback();
          }; 
      }
  </code></pre>
  
  <p>Finally the binding, which is inside the constructor for the view.  The view is a MT Dialog Element, hence the DelayBind():</p>
  
  <pre><code>this.DelayBind(() =&gt;
          {
              var set = this.CreateBindingSet&lt;CustomerElement, CustomerViewModel&gt;();
              ...
              set.Bind().For(my =&gt; my.ConfirmationInteraction).To(customer =&gt; customer.ConfirmCancelInteractionRequest);
              set.Apply();
          });
      }
  </code></pre>