# IControlViewFor

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui-controls/trait-icontrolviewfor/

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

```rust
trait IControlViewFor: ObjectType + Upcast<ferroui_controls::Control>
```

A control class that is a view of the view model type `ViewModel` (a control that implements
`IViewFor<TViewModel>` upstream, with a plain `ViewModel` property).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Controls/view_control.rs#L87)

## Members

- [`ViewModel`](#assoc_type-viewmodel)
- [`view_model_of`](#function-view_model_of)
- [`set_view_model_of`](#function-set_view_model_of)

<a id="assoc_type-viewmodel"></a>

### ViewModel

```rust
type ViewModel: PartialEq + 'static
```

The type of the view model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Controls/view_control.rs#L89)

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

### view_model_of

```rust
fn view_model_of(self: &Self) -> Option<Rc<<Self as >::ViewModel>>
```

The view model (`ViewModel { get; }`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Controls/view_control.rs#L92)

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

### set_view_model_of

```rust
fn set_view_model_of(self: &Self, view_model: Option<Rc<<Self as >::ViewModel>>)
```

Sets the view model (`ViewModel { set; }`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Controls/view_control.rs#L95)

## Availability

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