Why doesn't WPF Canvas alow drop?
问题 I have the following XAML for the main window: <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" /> </Grid> </Window> But when I try to drag a file to the window, drop is not allowed. When Canvas is changed to ListBox, everything works perfectly. How can the code be changed to allow drop to canvas? 回答1: By