# ManagedContextDragBehavior

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

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

```rust
struct ManagedContextDragBehavior
```

Behavior that initiates an in-process managed drag with an optional preview window.

This avoids the drag and drop of the system and integrates with [`ManagedDragDropService`](/docs/0.5.0/api/ferroui-xaml-interactions-draganddrop/struct-manageddragdropservice/):
the drop targets are `ManagedContextDropBehavior`s.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`context_property`](#function-context_property)
- [`preview_template_property`](#function-preview_template_property)
- [`horizontal_drag_threshold_property`](#function-horizontal_drag_threshold_property)
- [`vertical_drag_threshold_property`](#function-vertical_drag_threshold_property)
- [`preview_offset_property`](#function-preview_offset_property)
- [`data_format_property`](#function-data_format_property)
- [`use_pointer_relative_preview_offset_property`](#function-use_pointer_relative_preview_offset_property)
- [`preview_opacity_property`](#function-preview_opacity_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`context`](#function-context)
- [`set_context`](#function-set_context)
- [`preview_template`](#function-preview_template)
- [`set_preview_template`](#function-set_preview_template)
- [`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)
- [`preview_offset`](#function-preview_offset)
- [`set_preview_offset`](#function-set_preview_offset)
- [`data_format`](#function-data_format)
- [`set_data_format`](#function-set_data_format)
- [`use_pointer_relative_preview_offset`](#function-use_pointer_relative_preview_offset)
- [`set_use_pointer_relative_preview_offset`](#function-set_use_pointer_relative_preview_offset)
- [`preview_opacity`](#function-preview_opacity)
- [`set_preview_opacity`](#function-set_preview_opacity)

<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/managed_drag_drop/managed_context_drag_behavior.rs#L51)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### context_property

```rust
fn context_property() -> &'static StyledProperty<Option<BoxedValue>>
```

Gets or sets the context value used as a drag payload when the drag starts.

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

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

### preview_template_property

```rust
fn preview_template_property() -> &'static StyledProperty<Option<Rc<dyn IDataTemplate>>>
```

Gets or sets the data template used to render the drag preview window content.

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

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

### horizontal_drag_threshold_property

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

Gets or sets the minimal horizontal distance required to start dragging.

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

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

### vertical_drag_threshold_property

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

Gets or sets the minimal vertical distance required to start dragging.

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

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

### preview_offset_property

```rust
fn preview_offset_property() -> &'static StyledProperty<Point>
```

Gets or sets the fixed logical offset applied to the preview position. Ignored when
`UsePointerRelativePreviewOffset` is true and a pointer-relative offset is calculated.

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

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

### data_format_property

```rust
fn data_format_property() -> &'static StyledProperty<String>
```

Gets or sets the data format name used to identify the payload in managed drag
operations.

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

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

### use_pointer_relative_preview_offset_property

```rust
fn use_pointer_relative_preview_offset_property() -> &'static StyledProperty<bool>
```

Gets or sets whether to compute a pointer-relative preview offset automatically.

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

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

### preview_opacity_property

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

Gets or sets the preview window opacity.

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

<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/managed_drag_drop/managed_context_drag_behavior.rs#L221)

<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.DragAndDrop/managed_drag_drop/managed_context_drag_behavior.rs#L239)

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

### context

```rust
fn context(self: &Self) -> Option<BoxedValue>
```

Gets or sets the context value used as a drag payload when the drag starts.

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

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

### set_context

```rust
fn set_context(self: &Self, value: Option<BoxedValue>)
```



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

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

### preview_template

```rust
fn preview_template(self: &Self) -> Option<Rc<dyn IDataTemplate>>
```

Gets or sets the template used to render the drag preview.

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

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

### set_preview_template

```rust
fn set_preview_template(self: &Self, value: Option<Rc<dyn IDataTemplate>>)
```



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

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

### horizontal_drag_threshold

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

Gets or sets the minimal horizontal distance required to start dragging.

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

<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.DragAndDrop/managed_drag_drop/managed_context_drag_behavior.rs#L266)

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

### vertical_drag_threshold

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

Gets or sets the minimal vertical distance required to start dragging.

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

<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.DragAndDrop/managed_drag_drop/managed_context_drag_behavior.rs#L275)

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

### preview_offset

```rust
fn preview_offset(self: &Self) -> Point
```

Gets or sets a fixed logical offset added to the preview position.

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

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

### set_preview_offset

```rust
fn set_preview_offset(self: &Self, value: Point)
```



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

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

### data_format

```rust
fn data_format(self: &Self) -> String
```

Gets or sets the data format name used to identify the managed payload.

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

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

### set_data_format

```rust
fn set_data_format(self: &Self, value: String)
```



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

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

### use_pointer_relative_preview_offset

```rust
fn use_pointer_relative_preview_offset(self: &Self) -> bool
```

Gets or sets whether to compute a pointer-relative preview offset automatically.

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

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

### set_use_pointer_relative_preview_offset

```rust
fn set_use_pointer_relative_preview_offset(self: &Self, value: bool)
```



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

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

### preview_opacity

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

Gets or sets the preview window opacity.

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

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

### set_preview_opacity

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



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

## 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<ManagedContextDragBehavior>`](/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/).
