# DragAndDropEventsBehavior

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

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

```rust
struct DragAndDropEventsBehavior
```

Base class for behaviors that respond to drag-and-drop events: the drag events of the
`target_control`, or else of the associated control, go to the members
of [`DragAndDropEventsBehaviorImpl`](/docs/0.5.0/api/ferroui-xaml-interactions-draganddrop/trait-draganddropeventsbehaviorimpl/).

The class is abstract.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`on_drag_enter`](#function-on_drag_enter)
- [`on_drag_leave`](#function-on_drag_leave)
- [`on_drag_over`](#function-on_drag_over)
- [`on_drop`](#function-on_drop)
- [`target_control_property`](#function-target_control_property)
- [`construct`](#function-construct)
- [`target_control`](#function-target_control)
- [`set_target_control`](#function-set_target_control)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

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

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<DragAndDropEventsBehavior>
```

Returns a strong reference to this object.

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

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

### on_drag_enter

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

Called when a drag-and-drop operation enters the element.

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

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

### on_drag_leave

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

Called when a drag-and-drop operation leaves the element.

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

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

### on_drag_over

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

Called when a drag-and-drop operation is updated while over the element.

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

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

### on_drop

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

Called when a drag-and-drop operation should complete over the element.

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

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

### target_control_property

```rust
fn target_control_property() -> &'static StyledProperty<Option<ElementRef<Control>>>
```

Identifies the `TargetControl` property.

Deviation (DEVIATIONS.md, Behaviors): the control is held by an element reference (a
weak reference), as the framework holds the elements a property names.

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

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

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

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

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

### target_control

```rust
fn target_control(self: &Self) -> Option<Ref<Control>>
```

Gets or sets the control that is used as source for drag and drop events.

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

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

### set_target_control

```rust
fn set_target_control(self: &Self, value: Option<Ref<Control>>)
```



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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`DragAndDropEventsBehaviorImplExt`](/docs/0.5.0/api/ferroui-xaml-interactions-draganddrop/trait-draganddropeventsbehaviorimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`StyledElementBehaviorImplExt`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-styledelementbehaviorimplext/)
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<DragAndDropEventsBehavior>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`DragAndDropEventsBehaviorImpl`](/docs/0.5.0/api/ferroui-xaml-interactions-draganddrop/trait-draganddropeventsbehaviorimpl/)
- [`StyledElementBehaviorImpl`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-styledelementbehaviorimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)

## Availability

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