# DragPreviewService

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

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

```rust
struct DragPreviewService
```

Provides a lightweight preview window shown during a managed drag operation.

Deviation (DEVIATIONS.md, Behaviors): the preview window of the reference is shared by the
threads of the process; a window belongs to the thread that uses it, so there is one per
thread.

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

## Members

- [`show`](#function-show)
- [`DEFAULT_OPACITY`](#assoc_const-default_opacity)
- [`move_`](#function-move_)
- [`hide`](#function-hide)

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

### show

```rust
fn show(content: Option<BoxedValue>, template: Option<Rc<dyn IDataTemplate>>, origin: &TopLevel, client_position: Point, logical_offset: Point, opacity: f64)
```

Shows a drag preview near the current pointer position.

`content` is rendered inside the preview window, with `template` when there is one;
`origin` is the top-level where the drag originates, `client_position` the current pointer
position in its client coordinates, `logical_offset` a logical offset added to the preview
position in client coordinates and `opacity` the preview window opacity, clamped to 0..1.

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

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

### DEFAULT_OPACITY

```rust
const DEFAULT_OPACITY: f64
```

The default opacity of `show` (the default argument of the reference).

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

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

### move_

```rust
fn move_(origin: &TopLevel, client_position: Point, logical_offset: Point)
```

Moves the drag preview to a new client position of `origin`, plus `logical_offset`.

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

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

### hide

```rust
fn hide()
```

Hides the preview if shown.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`

## Availability

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