# IRoutableViewModel

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

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

```rust
trait IRoutableViewModel: IReactiveObject + Any
```

A view model that takes part in the navigation of a `RoutingState`
(`IRoutableViewModel`).

A routable view model names itself with a segment of a path, for diagnostics and breadcrumbs,
and knows the screen that hosts it, so that it can navigate further. It is shared as an
`Rc<dyn IRoutableViewModel>`; two of them are equal when they are the same object, as .NET
compares references.

The trait has `Any` as a supertrait, so that the stack can be searched for a view model of a
type (`RoutingStateMixins::find_view_model_in_stack`).

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

## Members

- [`url_path_segment`](#function-url_path_segment)
- [`host_screen`](#function-host_screen)

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

### url_path_segment

```rust
fn url_path_segment(self: &Self) -> Option<String>
```

A token that names the view model, such as `"login"` or `"user"` (`UrlPathSegment`).

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

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

### host_screen

```rust
fn host_screen(self: &Self) -> Option<Rc<dyn IScreen>>
```

The screen that hosts the view model (`HostScreen`).

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

## Availability

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