# ItemDragBehavior

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

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

```rust
struct ItemDragBehavior
```

Allows dragging items within an `ItemsControl`.

The behavior is attached to the container of an item (a list box item, a tab item, the content
presenter of an items control); while the item is dragged along the
`orientation` it is translated with the pointer, the containers it passes
make room for it, and on release the item moves to the index it was dropped at.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Draggable/item_drag_behavior.rs#L32)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`orientation_property`](#function-orientation_property)
- [`horizontal_drag_threshold_property`](#function-horizontal_drag_threshold_property)
- [`vertical_drag_threshold_property`](#function-vertical_drag_threshold_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`orientation`](#function-orientation)
- [`set_orientation`](#function-set_orientation)
- [`horizontal_drag_threshold`](#function-horizontal_drag_threshold)
- [`set_horizontal_drag_threshold`](#function-set_horizontal_drag_threshold)
- [`vertical_drag_threshold`](#function-vertical_drag_threshold)
- [`set_vertical_drag_threshold`](#function-set_vertical_drag_threshold)

<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.Draggable/item_drag_behavior.rs#L45)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Draggable/item_drag_behavior.rs#L45)

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

### orientation_property

```rust
fn orientation_property() -> &'static StyledProperty<Orientation>
```

Identifies the `Orientation` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Draggable/item_drag_behavior.rs#L49)

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

### horizontal_drag_threshold_property

```rust
fn horizontal_drag_threshold_property() -> &'static StyledProperty<f64>
```

Identifies the `HorizontalDragThreshold` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Draggable/item_drag_behavior.rs#L49)

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

### vertical_drag_threshold_property

```rust
fn vertical_drag_threshold_property() -> &'static StyledProperty<f64>
```

Identifies the `VerticalDragThreshold` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Draggable/item_drag_behavior.rs#L49)

<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.Draggable/item_drag_behavior.rs#L263)

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

### new

```rust
fn new() -> Ref<Self>
```

Creates the behavior.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Draggable/item_drag_behavior.rs#L279)

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

### orientation

```rust
fn orientation(self: &Self) -> Orientation
```

Gets or sets the orientation of the drag operation.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Draggable/item_drag_behavior.rs#L284)

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

### set_orientation

```rust
fn set_orientation(self: &Self, value: Orientation)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Draggable/item_drag_behavior.rs#L288)

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

### horizontal_drag_threshold

```rust
fn horizontal_drag_threshold(self: &Self) -> f64
```

Gets or sets the horizontal drag threshold in pixels.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Draggable/item_drag_behavior.rs#L293)

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

### set_horizontal_drag_threshold

```rust
fn set_horizontal_drag_threshold(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Draggable/item_drag_behavior.rs#L297)

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

### vertical_drag_threshold

```rust
fn vertical_drag_threshold(self: &Self) -> f64
```

Gets or sets the vertical drag threshold in pixels.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Draggable/item_drag_behavior.rs#L302)

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

### set_vertical_drag_threshold

```rust
fn set_vertical_drag_threshold(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Draggable/item_drag_behavior.rs#L306)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `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<ItemDragBehavior>`](/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/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`StyledElementBehaviorImpl`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-styledelementbehaviorimpl/)

## Availability

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