views:

155

answers:

1

Hi I'm trying to pass eventargs to comman that I bind in ViewModel. Everything works fine if I don't use PassEventArgsToCommand="True". But If put PassEventArgsToCommand="True" than app break. Did you have similar problem?

                <Controls:ListBoxDragDropTarget Grid.Column="1" AllowDrop="true" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" >
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Drop">
                        <GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding PersonDrop, Mode=OneWay}" PassEventArgsToCommand="True" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            <ListBox x:Name="fromListBox" ItemsSource="{Binding Person, Mode=TwoWay}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Name, Mode=TwoWay}"></TextBlock>
                                </DataTemplate>
                            </ListBox.ItemTemplate>                           
                        </ListBox>

            </Controls:ListBoxDragDropTarget>
+2  A: 

Ok. I found out. I used System.Windows.DragEventArgs instead of Microsoft.Windows.DragEventArgs as argument in my command.

Damir R.