title: Receiving messages with generic type parameter
body: <p>My VM sends notification messages to the View layer using a special generic class <code>AppMessage</code> (derives from <code>GenericMessage</code>):</p>
  
  <pre><code>public bool ShowDialog&lt;T&gt;(AppMessageType type, T arg) where T : class
  {
    bool Result = false;
    Action&lt;bool&gt; Callback = (o) =&gt; Result = o;
    Messenger.Default.Send(new AppMessage&lt;T, bool&gt;(type, Callback, arg));
    return Result;
  }
  </code></pre>
  
  <p>However, on the receiving end, I'm not sure how to call <code>Register</code> for all kinds of <code>T</code>. I can <code>Register</code> for messages of specific types such as:</p>
  
  <pre><code>Messenger.Default.Register&lt;AppMessage&lt;string, bool&gt;&gt;(this, OpenDialog);
  </code></pre>
  
  <p>but that works only for this specific type of argument. How can I register for all kinds of arguments?</p>
  
  <p>N.B. A similar question has been asked <a href="https://stackoverflow.com/questions/16593328/mvvm-light-register-generic-class-for-messenger">here</a>, with no good answer.</p>