# SelectionIndicatorAnimation

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

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

```rust
struct SelectionIndicatorAnimation
```

Creates and applies the composition animation used to move a selection indicator between
item containers.

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

## Members

- [`default_duration`](#function-default_duration)
- [`try_start`](#function-try_start)
- [`try_start_with_visuals`](#function-try_start_with_visuals)

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

### default_duration

```rust
fn default_duration() -> Duration
```

Gets the default selection indicator animation duration.

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

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

### try_start

```rust
fn try_start(new_selection: Option<&TemplatedControl>, old_selection: Option<&TemplatedControl>, duration: Duration) -> bool
```

Finds the standard selection indicator parts in the newly and the previously selected
item containers and starts their movement animation over `duration`. Returns `true` when
composition visuals were available and the animation was installed; otherwise, `false`.

The reference throws an `ArgumentOutOfRangeException` for a negative duration; a
`Duration` cannot be negative.

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

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

### try_start_with_visuals

```rust
fn try_start_with_visuals(new_indicator: Option<&Visual>, old_indicator: Option<&Visual>, new_selection: Option<&Visual>, old_selection: Option<&Visual>, duration: Duration) -> bool
```

Starts a selection indicator movement animation using explicitly supplied visuals: the
indicator visuals in the newly and the previously selected containers, and the container
visuals themselves. Returns `true` when composition visuals were available and the
animation was installed; otherwise, `false`.

Deviation (DEVIATIONS.md, Behaviors): the `TryStart(Visual, Visual, Visual, Visual,
TimeSpan)` overload of the reference; Rust has no overloads.

The reference throws an `ArgumentOutOfRangeException` for a negative duration; a
`Duration` cannot be negative.

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

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