我的形象是一个标签项目的内部:WPF dragEnter事件不触发对图像
<TabItem x:Name="tabThreeTb" Header="Photos" HorizontalAlignment="Left" Height="22" VerticalAlignment="Top" Width="55" Margin="1,0,-1,0">
<Grid x:Name="tabThreeBdy" Background="#FFE5E5E5">
<Rectangle Fill="#FFE5E5E5" HorizontalAlignment="Left" Height="369" Margin="12,13,0,0" Stroke="Black" VerticalAlignment="Top" Width="467">
<Rectangle.Effect>
<DropShadowEffect/>
</Rectangle.Effect>
</Rectangle>
<TextBox x:Name="picNotesTextBox" HorizontalAlignment="Left" Height="415" Margin="498,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="299"/>
<Button x:Name="nxtPhotoBtn" Content="Next" HorizontalAlignment="Left" Margin="404,403,0,0" VerticalAlignment="Top" Width="75"/>
<Button x:Name="prevPhotoBtn" Content="Prev" HorizontalAlignment="Left" Margin="10,403,0,0" VerticalAlignment="Top" Width="75"/>
<Label x:Name="photoNumLbl" Content="1 of 4" HorizontalAlignment="Left" Margin="226,401,0,0" VerticalAlignment="Top" Width="42"/>
<Image x:Name="photoTabImage" HorizontalAlignment="Left" Height="369" Margin="12,13,0,0" VerticalAlignment="Top" Width="467" AllowDrop="True" DragEnter="photoTabImage_DragEnter"/>
</Grid>
</TabItem>
我试图使用拖放到允许添加的照片到包含路径列表对于图像源,虽然我似乎无法启动DragEnter例程...
我希望拖放功能只在内容被拖到图像边界时才存在。
有什么我需要做的是嵌套在一个选项卡控件允许这个项目?
'图片'不会调用'DragEnter'和'DragOver'。这个错误wpf。使用其他控件覆盖'Image'。例如'标签' – 2015-04-03 06:20:45