# NavigateToAction

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

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

```rust
struct NavigateToAction
```

An action that resolves and navigates to a view model of a type (the `TViewModel` of the
reference, a [`RoutableViewModelType`](/docs/0.5.0/api/ferroui-xaml-interactions-reactiveui/struct-routableviewmodeltype/)).

Deviation (DEVIATIONS.md, Behaviors): the class is not generic; the view model type is given
when the action is created (`new`), and markup does not create the action (it
has no type arguments for it).

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`resolve_view_model`](#function-resolve_view_model)
- [`router_property`](#function-router_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`view_model_type`](#function-view_model_type)
- [`router`](#function-router)
- [`set_router`](#function-set_router)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

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

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<NavigateToAction>
```

Returns a strong reference to this object.

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

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

### resolve_view_model

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

Resolves an instance of the view model type from the service locator.

Returns the resolved view model instance or `None` if it cannot be created.

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

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

### router_property

```rust
fn router_property() -> &'static StyledProperty<Option<Rc<RoutingState>>>
```

Identifies the `Router` property.

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

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

### construct

```rust
fn construct(view_model_type: RoutableViewModelType) -> Self
```

Creates the class data for an action that navigates to view models of `view_model_type`
(the `TViewModel` of the reference); see `ferroui_base::FerroObject::construct`.

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

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

### new

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

Creates an action that navigates to view models of type `VM`.

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

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

### view_model_type

```rust
fn view_model_type(self: &Self) -> RoutableViewModelType
```

The view model type the action navigates to (the `TViewModel` of the reference).

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

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

### router

```rust
fn router(self: &Self) -> Option<Rc<RoutingState>>
```

Gets or sets the router used for navigation. This is a property of the object model.

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

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

### set_router

```rust
fn set_router(self: &Self, value: Option<Rc<RoutingState>>)
```



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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`NavigateToActionImplExt`](/docs/0.5.0/api/ferroui-xaml-interactions-reactiveui/trait-navigatetoactionimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`StyledElementActionImplExt`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-styledelementactionimplext/)
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<NavigateToAction>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`NavigateToActionImpl`](/docs/0.5.0/api/ferroui-xaml-interactions-reactiveui/trait-navigatetoactionimpl/)
- [`StyledElementActionImpl`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-styledelementactionimpl/)

## Availability

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