By default, Canvas
does not have a background, so a hit check does not raise the cursor over the Canvas
element, but instead bubbles up to the Grid
or Window
, which does not allow it to go down. Set the Transparent
background as follows and it should work:
<Window x:Class="ImageViewer.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="398" Width="434"> <Grid> <Canvas AllowDrop="True" Background="Transparent" /> </Grid> </Window>
source share