0
votes

Basically I have the following xaml:

<Window ...>
   <StackPanel>
       <my:UserControl> ... </my:UserControl>
       <my:UserControl> ... </my:UserControl>
   </StackPanel>
</Window>
  1. If my mouse left clicks within the I want to capture the X/Y coordinate.
  2. I want to capture the current MouseX/MouseY as as long as the mouse is within the Window.
  3. I want to use that capture in an event that is triggered everytime the mouse is moved while holding down the left click.

It's sort of like a drag/drop, but not necessarily a drag/drop... if using drag/drop will solve this than that's fine, I'll use that. But, I'm not sure where to really start.

1
Title does not match content. Within Window or with specific control?paparazzo

1 Answers

0
votes

Set a handler on Mousemove event of the window, check the mouse button state from the mouseevent args. There's also a method to check if certain element is hit, f.i. your user controls. What do you want to do on release? Depending on what you want to do, you could use an event trigger. However these tend to be limited in use.