我在下面有一个带有多个文本块项目模板的列表框 #1:
<ListBox Grid.Row="2"
x:Name="ItemListBox"
ItemsSource="{Binding Files}"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.CanContentScroll="True"
AlternationCount="2"
SelectedItem="{Binding FileSelectedItem, Mode=TwoWay}"
BorderThickness="1">
我有另一个列表框#2,我用来拖放绑定到存储数据的可观察集合的文件。
<ListBox ItemsSource="{Binding Path=DropFiles}"
Grid.Row="5" Name="DropBox"
AllowDrop="True"
BorderThickness="1"
AlternationCount="2"
DragOver="DropBox_DragOver"
DragLeave="DropBox_DragLeave"
Drop="DropBox_Drop" >
</ListBox>
我想在一个列表框上实现所有内容,所以基本上摆脱了第二个列表框,我可以将 DragOver、DragLeave 和 Drop 属性移动到第一个列表框,但是我遇到了第二个列表框的 DropFiles ItemsSource 属性的问题!任何回复或建议表示赞赏,谢谢!