What I want to do is a UserControl containing a section with a grid, where something happens when clicking on the grid. I need the position of the pixel where the click happened and I’m doing all of this MVVM style.
I know how I can prompt actions on my ViewModel:
<Grid>
<Grid.InputBindings>
<MouseBinding Gesture="LeftClick" Command="{Binding MinimapClick}"/>
</Grid.InputBindings>
</Grid>
My problem is now that I don’t know how to retrieve the Coordinates… any ideas?
I appreciate your help!
How about this?
If you don’t have a reference to the window you could send it as a parameter (or use whatever reference point you want).