# FluidMoveAnimation

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-xaml-behaviors-animations/struct-fluidmoveanimation/

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

```rust
struct FluidMoveAnimation
```

Creates and runs the translation animation used for fluid layout movement.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Behaviors.Animations/animations/fluid_move_animation.rs#L13)

## Members

- [`create`](#function-create)
- [`run`](#function-run)
- [`try_run`](#function-try_run)

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

### create

```rust
fn create(offset_x: f64, offset_y: f64, duration: SignedDuration) -> Ref<Animation>
```

Creates an animation from a previous layout offset (`offset_x`, `offset_y`) back to the
current position, over `duration`.
## Panics

When `duration` is negative (the `ArgumentOutOfRangeException` of the reference).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Behaviors.Animations/animations/fluid_move_animation.rs#L23)

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

### run

```rust
fn run(target: &Control, offset_x: f64, offset_y: f64, duration: SignedDuration)
```

Creates and starts a fluid movement animation on a control: `target` is the target
control, `offset_x` and `offset_y` the previous offsets, `duration` the animation duration.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Behaviors.Animations/animations/fluid_move_animation.rs#L46)

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

### try_run

```rust
fn try_run(target: Option<&Control>, offset_x: f64, offset_y: f64, duration: SignedDuration) -> bool
```

Prepares a control's translation transform and starts a fluid movement animation. Returns
`true` when the target was prepared and the animation was started; otherwise, `false`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Behaviors.Animations/animations/fluid_move_animation.rs#L56)

## 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/).
