gpt4 book ai didi

silverlight - mvvm light PassEventArgsToCommand 在 ListBox 拖放目标中中断应用程序

转载 作者:行者123 更新时间:2023-12-03 10:30:46 25 4
gpt4 key购买 nike

嗨,我正在尝试将 eventargs 传递给我在 ViewModel 中绑定(bind)的命令。如果我不使用 PassEventArgsToCommand="True",一切正常。但是如果把 PassEventArgsToCommand="True"比应用程序中断。你有类似的问题吗?

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

最佳答案

行。我发现。我在命令中使用 System.Windows.DragEventArgs 而不是 Microsoft.Windows.DragEventArgs 作为参数。

关于silverlight - mvvm light PassEventArgsToCommand 在 ListBox 拖放目标中中断应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3333167/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com