Why doesn't WPF Canvas alow drop?

后端 未结 2 876
星月不相逢
星月不相逢 2021-01-17 21:59

I have the following XAML for the main window:



        
2条回答
  •  生来不讨喜
    2021-01-17 22:40

    By default, Canvas has no background so hit-testing is not picking up that the cursor is over the Canvas element, but is instead bubbling up to the Grid or Window which don't allow drop. Set the background to Transparent as follows and it should work:

    
       
          
       
    
    

提交回复
热议问题