2010-07-26 8 views
1

Salut J'essaie de passer eventargs à comman que je lie dans ViewModel. Tout fonctionne correctement si je n'utilise pas PassEventArgsToCommand = "True". Mais si mis PassEventArgsToCommand = "True" que pause de l'application. Avez-vous eu un problème similaire?mvvm light PassEventArgsToCommand casser l'application dans ListBoxDragDropTarget

   <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> 

Répondre

2

Ok. J'ai découvert. J'ai utilisé System.Windows.DragEventArgs au lieu de Microsoft.Windows.DragEventArgs comme argument dans ma commande.