我已将事件处理程序附加到边框但似乎只有当我拖过一个孩子TextBlock
<Border BorderThickness="5" CornerRadius="20" Margin="15" BorderBrush="Black" AllowDrop="True" DragEnter="Border_DragEnter" Drop="Border_Drop">
<TextBlock Text="Drop images here" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontWeight="Bold" />
</Border>
答案 0 :(得分:2)
添加
Background="Transparent"
到你的边境接收鼠标事件。
了解详情:How to catch mouse left down if data template has a transparent background?