# set_data_context

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-static-view-locator/function-set_data_context/

**function** · [`ferroui-static-view-locator`](/docs/0.5.0/api/ferroui-static-view-locator/) · v0.5.0

```rust
fn set_data_context(control: &ferroui_base::Ref<ferroui_controls::Control>, data: &ferroui_base::BoxedValue)
```

Sets `data` as the data context of `control` (`control.DataContext = data`).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator/lib.rs#L117)

## Availability

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