# ActivatableLifetimeBase

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/application_lifetimes/struct-activatablelifetimebase/

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

```rust
struct ActivatableLifetimeBase
```

The base of the activatable lifetimes of the platforms: it owns the
activated and deactivated events and raises them on the UI thread.

A platform lifetime holds one of these, forwards its
[`IActivatableLifetime`](/docs/0.5.0/api/ferroui-controls/application_lifetimes/trait-iactivatablelifetime/) events to it and provides its own
`try_leave_background` / `try_enter_background`; used on its own, both
requests are refused.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/activatable_lifetime_base.rs#L14)

## Members

- [`new`](#function-new)
- [`on_activated_kind`](#function-on_activated_kind)
- [`on_activated`](#function-on_activated)
- [`on_deactivated_kind`](#function-on_deactivated_kind)
- [`on_deactivated`](#function-on_deactivated)

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

### new

```rust
fn new() -> Rc<Self>
```

Creates a lifetime base without handlers.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/activatable_lifetime_base.rs#L22)

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

### on_activated_kind

```rust
fn on_activated_kind(self: &Self, kind: ActivationKind)
```

Raises the activated event with arguments of the given kind.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/activatable_lifetime_base.rs#L31)

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

### on_activated

```rust
fn on_activated(self: &Self, event_args: ActivatedEventArgs)
```

Raises the activated event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/activatable_lifetime_base.rs#L36)

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

### on_deactivated_kind

```rust
fn on_deactivated_kind(self: &Self, kind: ActivationKind)
```

Raises the deactivated event with arguments of the given kind.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/activatable_lifetime_base.rs#L41)

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

### on_deactivated

```rust
fn on_deactivated(self: &Self, event_args: ActivatedEventArgs)
```

Raises the deactivated event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/application_lifetimes/activatable_lifetime_base.rs#L46)

## 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`
- [`IActivatableLifetime`](/docs/0.5.0/api/ferroui-controls/application_lifetimes/trait-iactivatablelifetime/)

## Availability

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