# IDropHandler

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-xaml-interactions-draganddrop/trait-idrophandler/

**trait** · [`ferroui-xaml-interactions-draganddrop`](/docs/0.5.0/api/ferroui-xaml-interactions-draganddrop/) · v0.5.0

```rust
trait IDropHandler
```

Defines callbacks for handling drag-and-drop operations.

`sender` is the drop target (an untyped value holding the object), `source_context` the data
dragged and `target_context` the context of the target.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.DragAndDrop/contract/i_drop_handler.rs#L11)

## Members

- [`enter`](#function-enter)
- [`over`](#function-over)
- [`drop`](#function-drop)
- [`leave`](#function-leave)
- [`validate`](#function-validate)
- [`execute`](#function-execute)
- [`cancel`](#function-cancel)

<a id="function-enter"></a>

### enter

```rust
fn enter(self: &Self, sender: Option<&BoxedValue>, e: &DragEventArgs, source_context: Option<&BoxedValue>, target_context: Option<&BoxedValue>)
```

Called when a drag enters the target.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.DragAndDrop/contract/i_drop_handler.rs#L13)

<a id="function-over"></a>

### over

```rust
fn over(self: &Self, sender: Option<&BoxedValue>, e: &DragEventArgs, source_context: Option<&BoxedValue>, target_context: Option<&BoxedValue>)
```

Called repeatedly as the drag moves over the target.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.DragAndDrop/contract/i_drop_handler.rs#L22)

<a id="function-drop"></a>

### drop

```rust
fn drop(self: &Self, sender: Option<&BoxedValue>, e: &DragEventArgs, source_context: Option<&BoxedValue>, target_context: Option<&BoxedValue>)
```

Called when the drag is dropped on the target.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.DragAndDrop/contract/i_drop_handler.rs#L31)

<a id="function-leave"></a>

### leave

```rust
fn leave(self: &Self, sender: Option<&BoxedValue>, e: &RoutedEventArgs)
```

Called when the drag leaves the target.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.DragAndDrop/contract/i_drop_handler.rs#L40)

<a id="function-validate"></a>

### validate

```rust
fn validate(self: &Self, sender: Option<&BoxedValue>, e: &DragEventArgs, source_context: Option<&BoxedValue>, target_context: Option<&BoxedValue>, state: Option<&BoxedValue>) -> bool
```

Validates whether the drag can be executed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.DragAndDrop/contract/i_drop_handler.rs#L43)

<a id="function-execute"></a>

### execute

```rust
fn execute(self: &Self, sender: Option<&BoxedValue>, e: &DragEventArgs, source_context: Option<&BoxedValue>, target_context: Option<&BoxedValue>, state: Option<&BoxedValue>) -> bool
```

Executes the drop logic.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.DragAndDrop/contract/i_drop_handler.rs#L53)

<a id="function-cancel"></a>

### cancel

```rust
fn cancel(self: &Self, sender: Option<&BoxedValue>, e: &RoutedEventArgs)
```

Cancels the drag operation.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.DragAndDrop/contract/i_drop_handler.rs#L63)

## Trait implementations

- [`IDropHandler`](/docs/0.5.0/api/ferroui-xaml-interactions-draganddrop/trait-idrophandler/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
