Skip to main content

avalonia-drag-drop-files

Stars13
Forks0
UpdatedJune 3, 2026 at 20:05

Wire file drag-and-drop into an Avalonia 11 view so users can drop files onto a window or control. Use when adding a drop a file here zone to an Avalonia app, when a drop handler never fires, when migrating from Avalonia 10 drag-drop, when reading the local paths of dropped files, when filtering dropped files by extension, or when showing visual feedback while dragging over a target. Covers enabling AllowDrop, handling the DragOver and Drop routed events, why DragOver must set DragEffects or Drop will not fire, reading dropped items via DataFormats.Files and IStorageItem.TryGetLocalPath (replacing the removed FileNames API), handling multiple files, and delegating to the view model so logic stays out of code-behind. Triggers on Avalonia drag and drop, drop files, AllowDrop, DragDrop.DropEvent, DragOver, DataFormats.Files, GetFiles, TryGetLocalPath, drop handler not firing, drag drop not working, drop a file onto the window.

Installation

Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.

SKILL.md
readonly