# AnimationFactory

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

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

```rust
struct AnimationFactory
```

Creates commonly used key-frame animations.

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

## Members

- [`create_fade_in`](#function-create_fade_in)
- [`create_fade_in_timeline`](#function-create_fade_in_timeline)

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

### create_fade_in

```rust
fn create_fade_in(initial_delay: SignedDuration, duration: SignedDuration) -> Ref<Animation>
```

Creates an opacity animation that holds at zero during the initial delay and then fades to
one.

`initial_delay` is the delay before the fade begins, `duration` the duration of the fade.
## Panics

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

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

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

### create_fade_in_timeline

```rust
fn create_fade_in_timeline(initial_delay: SignedDuration, fade_completion_time: SignedDuration, total_duration: SignedDuration) -> Ref<Animation>
```

Creates an opacity animation with explicit hold, completion, and total times.

`initial_delay` is the key time through which opacity remains zero, `fade_completion_time`
the key time at which opacity becomes one and `total_duration` the total animation
duration.
## Panics

When any supplied time is negative or the key times are not chronological (the
`ArgumentOutOfRangeException` of the reference).

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

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