<hc:Interaction.Triggers> <hc:EventTrigger EventName="PreviewMouseLeftButtonUp"> <hc:EventToCommand Command="{Binding AddPointCommand}" EventArgsConverterParameter="{Binding ElementName=Img}" PassEventArgsToCommand="True"> <hc:EventToCommand.EventArgsConverter> <converter:MouseEventArgs2PositionConverter /> </hc:EventToCommand.EventArgsConverter> </hc:EventToCommand> </hc:EventTrigger> </hc:Interaction.Triggers>
public class MouseEventArgs2PositionConverter : IEventArgsConverter { public object Convert(object value, object parameter) { var e = (MouseButtonEventArgs)value; var ele = (IInputElement)parameter; var p = e.GetPosition(ele); return p; } }