title: Mouse handlers in WPF/Caliburn Micro
body: <p>I've got what I consider a simple situation, but can't seem to figure out how to get it done.  I'm very new to WPF and the Caliburn Micro framework.  In my View, I have a Canvas and on this Canvas I have an Image.  I want to write some mouse event handlers (MouseLeftButtonDown, MouseLeftButtonUp, and MouseMove) that are called when the cursor is inside the Image.  I have successfully been able to create event handlers in the ViewModel, but I can't seem to figure out how to get the current cursor position inside the handlers.  The MouseEventArgs.GetPosition requires a IInputElement as an argument...not sure how to get that.</p>
  
  <p>Here's my XAML (view):</p>
  
  <pre><code>&lt;Canvas x:Name="ImageCanvas" &gt;    
      &lt;Image Source="{Binding DataImage}" 
             x:Name="ContainerImage"
                cal:Message.Attach=
                "[Event MouseLeftButtonDown] = [Action MouseDown_Image($source, $eventArgs)];
                 [Event MouseLeftButtonUp] = [Action MouseUp_Image($source, $eventArgs)];
                 [Event MouseMove] = [Action MouseMove_Image($source, $eventArgs)]"&gt;
      &lt;/Image&gt;
  &lt;/Canvas&gt;
  </code></pre>
  
  <p>Here's my C# (viewmodel)</p>
  
  <pre><code>public void MouseDown_Image(object sender, MouseEventArgs e)
      {
        // How do I get cursor position here??
  
        // convert to Image coordinates??
      }
  
  public void MouseUp_Image(object sender, MouseEventArgs e)
      {
        // How do I get cursor position here??
  
        // convert to Image coordinates??
      }
  
  public void MouseMove_Image(object sender, MouseEventArgs e)
      {
        // How do I get cursor position here??
  
        // convert to Image coordinates??
      }
  </code></pre>
  
  <p>Once I do this, I'll need to convert the mouse coordinates to coordinates on the Image...but first things first.  </p>
  
  <p>Thanks!!</p>