UIElement.AllowDrop property
이 콘텐츠는 아직 번역되지 않았습니다.
Gets or sets whether the element accepts drops, taking part in drop-target hit testing and receiving DragEnter, DragOver, DragLeave and Drop.
public bool AllowDrop { get; set; }Remarks
Section titled “Remarks”Setting AllowDrop on a Window additionally registers the window for drags from other applications. What the platform delivers varies:
- Windows: An STA UI thread gets the full protocol (DragEnter/Over/Leave/Drop, effect negotiation, native drag preview). .NET 6+ entry points default to MTA - apply
[STAThread]onMainto opt in. On MTA threads only file drop arrives, with no enter/over/leave and no preview. - Linux: Every drag reaches the window with all the formats it offers.
- macOS: A drag reaches the window when it carries files, a URL, text, HTML, rich text or an image; it then lists all the formats it offers.
On non-Window elements, AllowDrop only affects element-chain participation - element-level DragEnter/Over/Leave/Drop are bubbled by the framework drag router. Platform registration always happens at the window level.
Fluent: .AllowDrop(Boolean)
See Also
Section titled “See Also”- class UIElement
- namespace Aprillz.MewUI.Controls