开发者

mvvm light PassEventArgsToCommand break app in ListBoxDragDropTarget

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" />
     开发者_StackOverflow社区               </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>


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜