# IActivationForViewFetcher

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/activation/trait-iactivationforviewfetcher/

**trait** · [`ferroui-reactiveui`](/docs/0.5.0/api/ferroui-reactiveui/) · v0.5.0

```rust
trait IActivationForViewFetcher
```

Tells when a view is activated and deactivated (`IActivationForViewFetcher`); usually only
the integration of a user-interface toolkit implements it.

A fetcher translates the signals of a toolkit (the view entering or leaving the visual tree,
navigation, visibility) into activation. Several fetchers are registered in `AppLocator` as
`dyn IActivationForViewFetcher`; for a view, the one with the highest affinity is used.

The integration with FerroUI registers the fetcher of its controls; a test registers a fetcher
of its own, as upstream's tests do.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/activation/i_activation_for_view_fetcher.rs#L19)

## Members

- [`get_affinity_for_view`](#function-get_affinity_for_view)
- [`get_activation_for_view`](#function-get_activation_for_view)

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

### get_affinity_for_view

```rust
fn get_affinity_for_view(self: &Self, view: &dyn IActivatableView) -> i32
```

How well this fetcher can activate `view`: zero when it cannot, a positive score when it
can, where the highest score wins (`GetAffinityForView`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/activation/i_activation_for_view_fetcher.rs#L22)

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

### get_activation_for_view

```rust
fn get_activation_for_view(self: &Self, view: &Rc<dyn IActivatableView>) -> Rc<dyn IObservable<bool>>
```

The activation of `view`: `true` when it is activated, `false` when it is deactivated
(`GetActivationForView`). Called after `get_affinity_for_view`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/activation/i_activation_for_view_fetcher.rs#L26)

## Trait implementations

- [`IActivationForViewFetcher`](/docs/0.5.0/api/ferroui-reactiveui/activation/trait-iactivationforviewfetcher/)

## Availability

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