# XamlBindingHelper

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/templates/struct-xamlbindinghelper/

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

```rust
struct XamlBindingHelper
```

WinUI's `XamlBindingHelper`: the attached property of the template component of an element.

The root of a template instance with `{x:Bind}` bindings carries the bindings of the instance
as its component; a container that finds one drives the instance through it instead of its
data context.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/templates/i_data_template_component.rs#L48)

## Members

- [`TYPE`](#assoc_const-type)
- [`data_template_component_property`](#function-data_template_component_property)
- [`get_data_template_component`](#function-get_data_template_component)
- [`set_data_template_component`](#function-set_data_template_component)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this type.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/templates/i_data_template_component.rs#L50)

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

### data_template_component_property

```rust
fn data_template_component_property() -> &'static AttachedProperty<Option<Rc<dyn IDataTemplateComponent>>>
```

The template component of the root of a template instance.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/templates/i_data_template_component.rs#L52)

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

### get_data_template_component

```rust
fn get_data_template_component(element: &Control) -> Option<Rc<dyn IDataTemplateComponent>>
```

The template component of `element`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/templates/i_data_template_component.rs#L63)

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

### set_data_template_component

```rust
fn set_data_template_component(element: &Control, component: Option<Rc<dyn IDataTemplateComponent>>)
```

Sets the template component of `element`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/templates/i_data_template_component.rs#L68)

## 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`
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)

## Availability

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