Add warning that DragEnter does not work unless Canvas Background is set
For the most part, this page was very helpful and clearly written. However, there is one "gotcha" that can cause a huge headache for your readers.
It occurs with controls like the Canvas control. In addition to setting the AllowDrop property, it is also necessary to set the Background property. Otherwise, the Canvas is not recognized as a valid drop target, the "not allowed" cursor is displayed, and the DragEnter and Drop events never fire.
Adding a simple warning about the Background property could save developers a lot of time.
I recently spent an afternoon re-discovering this entirely non-obvious requirement. It would be great if you could help other developers avoid this time waste :) Thank you.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 0d8003ab-20fc-501b-dc2a-a1810449483d
- Version Independent ID: ca183356-078d-1538-1aa4-d3d7d604231b
- Content: Drag and Drop Overview - WPF .NET Framework
- Content Source: dotnet-desktop-guide/framework/wpf/advanced/drag-and-drop-overview.md
- Product: dotnet-framework
- Technology: dotnet-wpf
- GitHub Login: @adegeo
- Microsoft Alias: adegeo