Using EventToCommand in an ItemsControl

Jan 20, 2012 at 9:59 AM

I use Interaction.Triggers to route events to my view model. More precise the events belong to items of an observable collection. As long as I need no arguments to hand over all works fine with 'CallMethodAction' (like MouseDoubleClick). Now I need to hand over also the related arguments for DragDelta (DragDeltaEventArgs). But trying to do that using EventToCommand I receive the following error (translated) message: "The value of the EventToCommand-Type cannot be added to lists or dictionaries of the ActionCollection-Type". Is there any possibility to solve that problem?

 

 

<i:Interaction.Triggers>

<i:EventTrigger EventName="MouseDoubleClick">
	<is:CallMethodAction TargetObject="{Binding}" MethodName="Thumb_MouseDouble" />
</i:EventTrigger>


<i:EventTrigger EventName="DragDelta">
	<cmd:EventToCommand PassEventArgsToCommand="True" Command="{Binding DragCommand}" />
</i:EventTrigger>

</i:Interaction.Triggers>