Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the drag-drop on a visual for WPF #1972

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ This topic provides an overview of drag-and-drop support in Windows Presentation

- Processing the dropped data.

To specify that an element is a drop target, you set its <xref:System.Windows.UIElement.AllowDrop%2A> property to `true`. The drop target events will then be raised on the element so that you can handle them. During a drag-and-drop operation, the following sequence of events occurs on the drop target:
To specify that an element is a drop target, you set its <xref:System.Windows.UIElement.AllowDrop%2A> property to `true`. The drop target events will then be raised on the element so that you can handle them.

When a drop target is evaluated, a hit test is performed to identify if the cursor is over the element's visual. Some controls, such as the <xref:System.Windows.Controls.Canvas>, don't have a visual and can't be used as a drop target unless a visual is added. Set the `Canvas.Background` property to any color to create a visual that fills the `Canvas` with color. To keep the `Canvas` transparent but enable it as a drop target, set the `Background` property to `Transparent`.

During a drag-and-drop operation, the following sequence of events occurs on the drop target:

1. <xref:System.Windows.DragDrop.DragEnter>

Expand Down
Loading