# TemplateBinding

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/data/struct-templatebinding/

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

```rust
struct TemplateBinding
```

A lightweight binding to a property of an element's templated parent.

A binding is a mutable reference object: it is created with
`TemplateBinding::empty` or `TemplateBinding::new`, configured
property by property (or with the chaining `with_*` forms) and shared
as `Rc<TemplateBinding>`, which converts to `Rc<dyn BindingBase>`.
Handles compare by identity. The properties are read when the binding
is instantiated on a target: changing them afterwards affects later
instances only.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

## Members

- [`snapshot_for_reload`](#function-snapshot_for_reload)
- [`converter`](#function-converter)
- [`set_converter`](#function-set_converter)
- [`with_converter_value`](#function-with_converter_value)
- [`converter_culture`](#function-converter_culture)
- [`set_converter_culture`](#function-set_converter_culture)
- [`with_converter_culture`](#function-with_converter_culture)
- [`converter_parameter`](#function-converter_parameter)
- [`set_converter_parameter`](#function-set_converter_parameter)
- [`with_converter_parameter`](#function-with_converter_parameter)
- [`mode`](#function-mode)
- [`set_mode`](#function-set_mode)
- [`with_mode`](#function-with_mode)
- [`property`](#function-property)
- [`set_property`](#function-set_property)
- [`with_property`](#function-with_property)
- [`empty`](#function-empty)
- [`new`](#function-new)
- [`with_converter`](#function-with_converter)
- [`provide_value`](#function-provide_value)

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

### snapshot_for_reload

```rust
fn snapshot_for_reload(self: &Self) -> ::std::rc::Rc<Self>
```

An independent description for a development transaction. Keep it
only through preparation: explicit sources can own application objects.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### converter

```rust
fn converter(self: &Self) -> Option<Rc<dyn IValueConverter>>
```

The converter to use.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### set_converter

```rust
fn set_converter(self: &Self, value: Option<Rc<dyn IValueConverter>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### with_converter_value

```rust
fn with_converter_value(self: ::std::rc::Rc<Self>, value: Option<Rc<dyn IValueConverter>>) -> ::std::rc::Rc<Self>
```

The chaining form of the setter.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### converter_culture

```rust
fn converter_culture(self: &Self) -> Option<CultureInfo>
```

The culture in which to evaluate the converter. `None` (the
default) uses the current culture.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### set_converter_culture

```rust
fn set_converter_culture(self: &Self, value: Option<CultureInfo>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### with_converter_culture

```rust
fn with_converter_culture(self: ::std::rc::Rc<Self>, value: Option<CultureInfo>) -> ::std::rc::Rc<Self>
```

The chaining form of the setter.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### converter_parameter

```rust
fn converter_parameter(self: &Self) -> Option<BoxedValue>
```

A parameter to pass to the converter.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### set_converter_parameter

```rust
fn set_converter_parameter(self: &Self, value: Option<BoxedValue>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### with_converter_parameter

```rust
fn with_converter_parameter(self: ::std::rc::Rc<Self>, value: Option<BoxedValue>) -> ::std::rc::Rc<Self>
```

The chaining form of the setter.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### mode

```rust
fn mode(self: &Self) -> BindingMode
```

The binding mode.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### set_mode

```rust
fn set_mode(self: &Self, value: BindingMode)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### with_mode

```rust
fn with_mode(self: ::std::rc::Rc<Self>, value: BindingMode) -> ::std::rc::Rc<Self>
```

The chaining form of the setter.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### property

```rust
fn property(self: &Self) -> Option<&'static FerroProperty>
```

The property of the templated parent being bound; `None` binds to
the templated parent itself.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### set_property

```rust
fn set_property(self: &Self, value: Option<&'static FerroProperty>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### with_property

```rust
fn with_property(self: ::std::rc::Rc<Self>, value: Option<&'static FerroProperty>) -> ::std::rc::Rc<Self>
```

The chaining form of the setter.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L8)

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

### empty

```rust
fn empty() -> Rc<Self>
```

Creates a binding without a property (the parameterless
constructor).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L37)

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

### new

```rust
fn new(property: &'static FerroProperty) -> Rc<Self>
```

Creates a binding to the given property of the templated parent.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L42)

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

### with_converter

```rust
fn with_converter(self: Rc<Self>, converter: Rc<dyn IValueConverter>) -> Rc<Self>
```

The chaining form of `set_converter`, for a
converter.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L48)

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

### provide_value

```rust
fn provide_value(self: &Rc<Self>) -> Rc<dyn BindingBase>
```

The binding itself: what the markup extension form of the binding
provides.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/template_binding.rs#L54)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`
- `Default`
- `PartialEq`
- [`BindingBase`](/docs/0.5.0/api/ferroui-base/data/trait-bindingbase/)
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- [`ValueTypeRegistration`](/docs/0.5.0/api/ferroui-base/data/core/trait-valuetyperegistration/)

## Availability

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