我的形象是一個標籤項目的內部: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