# BindableView

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui-controls/struct-bindableview/

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

```rust
struct BindableView<C: IReactiveViewClass, VM: PartialEq + 'static>
```

A control of a reactive view class (a document whose root is `ReactiveUserControlBase` or
`ReactiveWindowBase`) as the view that the bindings of ReactiveUI take: an `IViewFor<VM>` over the
control's `ViewModel` property, which raises `PropertyChanged` for `ViewModel` when the property
changes.

It holds the control weakly, so that the activation of the control, which holds the view, does
not keep the control alive.

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

## Members

- [`new`](#function-new)
- [`control`](#function-control)
- [`view_model`](#function-view_model)
- [`set_view_model`](#function-set_view_model)

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

### new

```rust
fn new(control: &Ref<C>) -> Rc<Self>
```

The view of `control`.

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

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

### control

```rust
fn control(self: &Self) -> Option<Ref<C>>
```

The control, while it is alive.

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

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

### view_model

```rust
fn view_model(self: &Self) -> Option<Rc<VM>>
```

The view model the control holds, when it is a `VM` (`ViewModel`).

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

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

### set_view_model

```rust
fn set_view_model(self: &Self, view_model: Option<Rc<VM>>)
```

Sets the view model of the control (`ViewModel = value`).

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`IntoViewFor`](/docs/0.5.0/api/ferroui-reactiveui/binding/interfaces/trait-intoviewfor/)
- [`INotifyPropertyChanged`](/docs/0.5.0/api/ferroui-base/data/model/use-inotifypropertychanged/)
- [`IViewControl`](/docs/0.5.0/api/ferroui-reactiveui-controls/trait-iviewcontrol/)
- [`IActivatableView`](/docs/0.5.0/api/ferroui-reactiveui/binding/interfaces/trait-iactivatableview/)
- [`IViewFor`](/docs/0.5.0/api/ferroui-reactiveui/binding/interfaces/trait-iviewfor/)
- [`IViewForOf<VM>`](/docs/0.5.0/api/ferroui-reactiveui/binding/interfaces/trait-iviewforof/)

## Availability

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