# ReactiveUserControl

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui-controls/type_alias-reactiveusercontrol/

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

```rust
type ReactiveUserControl<VM> = crate::reactive_view::ReactiveView<crate::ReactiveUserControlBase, VM>
```

A ReactiveUI `UserControl` that implements `IViewFor<TViewModel>`
(`ReactiveUserControl<TViewModel>`).

Deviation (DEVIATIONS.md, ReactiveUI controls): a typed handle over a
[`ReactiveUserControlBase`](/docs/0.5.0/api/ferroui-reactiveui-controls/struct-reactiveusercontrolbase/) ([`ReactiveView`](/docs/0.5.0/api/ferroui-reactiveui-controls/struct-reactiveview/)): it dereferences to the control, gives and
takes the view model as `Rc<VM>`, and makes the control take only view models of type `VM` from
its data context (`IsValidViewModelValue`). Shared as an `Rc`, it is the control's
`IViewFor<TViewModel>` (`into_view_for_of`). A class derived
from the base (one of markup) is typed with `from_control`.

```ignore
let view = ReactiveUserControl::<LoginViewModel>::new();
view.set_view_model(Some(view_model.clone()));
assert!(view.data_context().is_some());
```

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

## Availability

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