# RoutableViewModelType

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-xaml-interactions-reactiveui/struct-routableviewmodeltype/

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

```rust
struct RoutableViewModelType
```

The view model type an action resolves and navigates to (the `TViewModel` of
[`NavigateToAction`](/docs/0.5.0/api/ferroui-xaml-interactions-reactiveui/struct-navigatetoaction/) and `NavigateToAndResetAction`).

Deviation (DEVIATIONS.md, Behaviors): the classes of the object model are not generic, so the
type argument of the reference is this value, made with `of` for a Rust type that
implements `IRoutableViewModel`. It casts a parameter to the type (`parameter as
TViewModel`) and resolves an instance of the type from the service locator
(`Locator.Current.GetService<TViewModel>()`).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/navigate_to_action.rs#L25)

## Members

- [`of`](#function-of)
- [`name`](#function-name)
- [`cast`](#function-cast)
- [`resolve`](#function-resolve)

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

### of

```rust
fn of<VM: IRoutableViewModel + 'static>() -> Self
```

The view model type `VM`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/navigate_to_action.rs#L33)

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

### name

```rust
fn name(self: &Self) -> &'static str
```

The Rust name of the type.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/navigate_to_action.rs#L38)

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

### cast

```rust
fn cast(self: &Self, value: &BoxedValue) -> Option<RoutableViewModel>
```

The value as a view model of the type (`value as TViewModel`): a shared view model of the
type (`Rc<VM>`, the object itself, or a routable view model whose object is of the type).
`None` for anything else.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/navigate_to_action.rs#L45)

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

### resolve

```rust
fn resolve(self: &Self) -> Option<RoutableViewModel>
```

An instance of the type from the service locator, or `None` if it cannot be created
(`Locator.Current.GetService<TViewModel>()`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.ReactiveUI/navigate_to_action.rs#L51)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Debug`

## Availability

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