# IActivatableView

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/binding/interfaces/trait-iactivatableview/

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

```rust
trait IActivatableView: Any
```

The marker of a view that can be activated (`IActivatableView`); every
[`IViewFor`](/docs/0.5.0/api/ferroui-reactiveui/binding/interfaces/trait-iviewfor/) is one. Upstream declares no members.

It is `Any`, so that the code that activates a view (the activation fetchers) can find the
concrete type of the view behind a `&dyn IActivatableView`.

Deviation (DEVIATIONS.md, ReactiveUI): upstream asks a view at run time whether it is an
`IViewFor` and whether it raises `PropertyChanged` (`view is IViewFor`, `view is
INotifyPropertyChanged`), which Rust cannot ask of a trait object. The two provided methods
answer it; a view overrides them, and `view_for!` writes them.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/interfaces/i_activatable_view.rs#L18)

## Members

- [`as_view_for`](#function-as_view_for)
- [`as_notify_property_changed`](#function-as_notify_property_changed)
- [`as_can_activate`](#function-as_can_activate)

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

### as_view_for

```rust
fn as_view_for(self: &Self) -> Option<&dyn IViewFor>
```

The view as an `IViewFor`, when it is one (`view as IViewFor`); `None` by default.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/interfaces/i_activatable_view.rs#L20)

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

### as_notify_property_changed

```rust
fn as_notify_property_changed(self: Rc<Self>) -> Option<Rc<dyn INotifyPropertyChanged>>
```

The change notification of the view, when it raises `PropertyChanged`
(`view as INotifyPropertyChanged`); `None` by default. The property observation of the
view's `ViewModel` uses it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/interfaces/i_activatable_view.rs#L27)

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

### as_can_activate

```rust
fn as_can_activate(self: &Self) -> Option<&dyn crate::ICanActivate>
```

The view as an `ICanActivate`, when it is one
(`view as ICanActivate`); `None` by default. `CanActivateViewFetcher` uses it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/interfaces/i_activatable_view.rs#L33)

## Availability

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