# IContentControl

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/trait-icontentcontrol/

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

```rust
trait IContentControl
```

Defines a control that displays content according to a data template.

A class implementing the trait is made known with
[`register_content_control`](/docs/0.5.0/api/ferroui-controls/function-register_content_control/), normally from its class initialization;
[`as_content_control`](/docs/0.5.0/api/ferroui-controls/function-as_content_control/) then views an object of the class (or of a class
derived from it) as the interface.

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

## Members

- [`content`](#function-content)
- [`set_content`](#function-set_content)
- [`content_template`](#function-content_template)
- [`set_content_template`](#function-set_content_template)
- [`horizontal_content_alignment`](#function-horizontal_content_alignment)
- [`set_horizontal_content_alignment`](#function-set_horizontal_content_alignment)
- [`vertical_content_alignment`](#function-vertical_content_alignment)
- [`set_vertical_content_alignment`](#function-set_vertical_content_alignment)

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

### content

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

The content to display.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/i_content_control.rs#L15)

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

### set_content

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

Sets the content to display.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/i_content_control.rs#L18)

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

### content_template

```rust
fn content_template(self: &Self) -> Option<Rc<dyn IDataTemplate>>
```

The data template used to display the content of the control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/i_content_control.rs#L21)

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

### set_content_template

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

Sets the data template used to display the content of the control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/i_content_control.rs#L24)

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

### horizontal_content_alignment

```rust
fn horizontal_content_alignment(self: &Self) -> HorizontalAlignment
```

The horizontal alignment of the content within the control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/i_content_control.rs#L27)

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

### set_horizontal_content_alignment

```rust
fn set_horizontal_content_alignment(self: &Self, value: HorizontalAlignment)
```

Sets the horizontal alignment of the content within the control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/i_content_control.rs#L30)

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

### vertical_content_alignment

```rust
fn vertical_content_alignment(self: &Self) -> VerticalAlignment
```

The vertical alignment of the content within the control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/i_content_control.rs#L33)

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

### set_vertical_content_alignment

```rust
fn set_vertical_content_alignment(self: &Self, value: VerticalAlignment)
```

Sets the vertical alignment of the content within the control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/i_content_control.rs#L36)

## Trait implementations

- [`IContentControl`](/docs/0.5.0/api/ferroui-controls/trait-icontentcontrol/)

## Availability

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