# FadeAnimation

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

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

```rust
struct FadeAnimation
```

Provides fade animation helpers using composition animations.

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

## Members

- [`set_fade_in`](#function-set_fade_in)
- [`set_fade_out`](#function-set_fade_out)
- [`set_custom_fade`](#function-set_custom_fade)

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

### set_fade_in

```rust
fn set_fade_in(element: &Control, milliseconds: f64)
```

Applies a fade-in animation to the element when loaded, over `milliseconds`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Behaviors.Animations/composition/fade_animation.rs#L14)

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

### set_fade_out

```rust
fn set_fade_out(element: &Control, milliseconds: f64)
```

Applies a fade-out animation to the element when loaded, over `milliseconds`.

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

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

### set_custom_fade

```rust
fn set_custom_fade(element: &Control, from_opacity: f64, to_opacity: f64, milliseconds: f64)
```

Applies a custom fade animation to the element when loaded: from `from_opacity` to
`to_opacity` (0.0 to 1.0), over `milliseconds`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Behaviors.Animations/composition/fade_animation.rs#L33)

## 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`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)

## Availability

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