# ItemsControlImpl

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

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

```rust
trait ItemsControlImpl: TemplatedControlImpl + $crate::Upcast<ItemsControl>
```

The overridable members introduced by the class.

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

## Members

- [`create_container_for_item_override`](#function-create_container_for_item_override)
- [`prepare_container_for_item_override`](#function-prepare_container_for_item_override)
- [`container_for_item_prepared_override`](#function-container_for_item_prepared_override)
- [`container_index_changed_override`](#function-container_index_changed_override)
- [`clear_container_for_item_override`](#function-clear_container_for_item_override)
- [`needs_container_override`](#function-needs_container_override)
- [`on_items_view_collection_changed`](#function-on_items_view_collection_changed)

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

### create_container_for_item_override

```rust
fn create_container_for_item_override(this: &Self, item: &Option<BoxedValue>, index: i32, recycle_key: Option<RecycleKey>) -> Ref<Control>
```

Creates or a container that can be used to display an item.

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

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

### prepare_container_for_item_override

```rust
fn prepare_container_for_item_override(this: &Self, container: &Ref<Control>, item: &Option<BoxedValue>, index: i32)
```

Prepares the specified element to display the specified item.

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

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

### container_for_item_prepared_override

```rust
fn container_for_item_prepared_override(this: &Self, container: &Ref<Control>, item: &Option<BoxedValue>, index: i32)
```

Called when a container has been fully prepared to display an
item.

This method will be called when a container has been fully
prepared and added to the logical and visual trees, but may be
called before a layout pass has completed. It is called
immediately before the `container_prepared` event is raised.

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

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

### container_index_changed_override

```rust
fn container_index_changed_override(this: &Self, container: &Ref<Control>, old_index: i32, new_index: i32)
```

Called when the index for a container changes due to an
insertion or removal in the items collection.

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

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

### clear_container_for_item_override

```rust
fn clear_container_for_item_override(this: &Self, container: &Ref<Control>)
```

Undoes the effects of the `prepare_container_for_item_override`
method.

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

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

### needs_container_override

```rust
fn needs_container_override(this: &Self, item: &Option<BoxedValue>, index: i32) -> (bool, Option<RecycleKey>)
```

Determines whether the specified item can be its own container.

Returns true if the item needs a container; otherwise false if
the item can itself be used as a container. The second value is
a key that can be used to locate a previously recycled container
of the correct type, or `None` if the item cannot be recycled.
If the item is its own container then by definition it cannot be
recycled, so the key should be `None`.

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

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

### on_items_view_collection_changed

```rust
fn on_items_view_collection_changed(this: &Self, e: &ItemsChangedEventArgs<'_>)
```

Called when the collection changed event is raised on the items
view.

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

## Trait implementations

- [`ItemsControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-itemscontrolimpl/)

## Availability

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