# RoutableViewModelMixins

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/routing/trait-routableviewmodelmixins/

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

```rust
trait RoutableViewModelMixins
```

The navigation focus of a routable view model: what to do while it is the current view model
of its screen's router (`RoutableViewModelMixins`), on its shared handle.

The router is the one of `host_screen`; a view model
without a screen panics (upstream's `NullReferenceException`).

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

## Members

- [`when_navigated_to`](#function-when_navigated_to)
- [`when_navigated_to_observable`](#function-when_navigated_to_observable)
- [`when_navigating_from_observable`](#function-when_navigating_from_observable)

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

### when_navigated_to

```rust
fn when_navigated_to(self: &Self, on_navigated_to: impl Fn() -> Rc<dyn IDisposable> + 'static) -> Rc<dyn IDisposable>
```

Runs `on_navigated_to` each time the view model becomes the topmost of the stack, and
disposes what it returned when the view model loses the top (`WhenNavigatedTo`).

The returned disposable stops watching and disposes the scope in force.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/routing/routable_view_model_mixins.rs#L23)

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

### when_navigated_to_observable

```rust
fn when_navigated_to_observable(self: &Self) -> Rc<dyn IObservable<()>>
```

Ticks each time the view model becomes the topmost of the stack, at once when it already
is; completes when the view model is removed from the stack (`WhenNavigatedToObservable`).
A view model removed and reused later is watched again with a new call.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/routing/routable_view_model_mixins.rs#L28)

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

### when_navigating_from_observable

```rust
fn when_navigating_from_observable(self: &Self) -> Rc<dyn IObservable<()>>
```

Ticks each time the view model stops being the topmost of the stack; completes when the
view model is removed from the stack (`WhenNavigatingFromObservable`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/routing/routable_view_model_mixins.rs#L32)

## Trait implementations

- [`RoutableViewModelMixins`](/docs/0.5.0/api/ferroui-reactiveui/routing/trait-routableviewmodelmixins/)

## Availability

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