# ViewLocatorMixins

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

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

```rust
trait ViewLocatorMixins
```

The generic resolutions of a view locator (`ViewLocatorMixins`), implemented for
`dyn IViewLocator` and every locator.

Deviation (DEVIATIONS.md, ReactiveUI): upstream's overloads that supply the default contract
are the same methods with `None`; the untyped ones (`ResolveView(object?)`,
`ResolveViewUnsafe(object?)`) are `IViewLocator::resolve_view` and
`IViewLocator::resolve_view_unsafe` with `None`. The null checks of the locator have no
counterpart.

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

## Members

- [`resolve_view_of`](#function-resolve_view_of)
- [`resolve_view_for`](#function-resolve_view_for)

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

### resolve_view_of

```rust
fn resolve_view_of<VM: 'static>(self: &Self, view_model: &Rc<VM>, contract: Option<&str>) -> Option<Rc<dyn IViewFor>>
```

Resolves the view of `view_model` through its compile-time type `VM`
(`ResolveView<TViewModel>(TViewModel, string?)`); the view's view model is set.

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

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

### resolve_view_for

```rust
fn resolve_view_for<VM: 'static>(self: &Self, contract: Option<&str>) -> Option<Rc<dyn IViewForOf<VM>>>
```

Resolves a view of the type `VM` without a view model (`ResolveView<TViewModel>(string?)`):
a `DefaultViewLocator` asks its mappings, then the service locator; any other locator has
no lookup by type, so the service locator is asked for `dyn IViewForOf<VM>` directly. The
view's view model is left unset.

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

## Trait implementations

- [`ViewLocatorMixins`](/docs/0.5.0/api/ferroui-reactiveui/binding/interfaces/trait-viewlocatormixins/)

## Availability

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