# FlowLayoutAlgorithm

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls-repeater/layouts/struct-flowlayoutalgorithm/

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

```rust
struct FlowLayoutAlgorithm
```

The bidirectional realization and line-arrangement engine shared by the
three WinUI flow-based layouts. Callbacks are borrowed for each operation
instead of stored as an unowned C++ pointer.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/flow_layout_algorithm.rs#L123)

## Members

- [`element_manager`](#struct_field-element_manager)
- [`new`](#function-new)
- [`initialize_for_context`](#function-initialize_for_context)
- [`uninitialize_for_context`](#function-uninitialize_for_context)
- [`last_extent`](#function-last_extent)
- [`get_element_if_realized`](#function-get_element_if_realized)
- [`on_items_source_changed`](#function-on_items_source_changed)
- [`measure`](#function-measure)
- [`arrange`](#function-arrange)
- [`measure_element`](#function-measure_element)

<a id="struct_field-element_manager"></a>

### element_manager

```rust
element_manager: super::ElementManager
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/flow_layout_algorithm.rs#L124)

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

### new

```rust
fn new() -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/flow_layout_algorithm.rs#L147)

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

### initialize_for_context

```rust
fn initialize_for_context(self: &Self, context: &Ref<VirtualizingLayoutContext>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/flow_layout_algorithm.rs#L163)

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

### uninitialize_for_context

```rust
fn uninitialize_for_context(self: &Self, context: &Ref<VirtualizingLayoutContext>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/flow_layout_algorithm.rs#L167)

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

### last_extent

```rust
fn last_extent(self: &Self) -> Rect
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/flow_layout_algorithm.rs#L182)

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

### get_element_if_realized

```rust
fn get_element_if_realized(self: &Self, index: i32) -> Option<Ref<Control>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/flow_layout_algorithm.rs#L194)

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

### on_items_source_changed

```rust
fn on_items_source_changed(self: &Self, args: &ItemsChangedEventArgs<'_>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/flow_layout_algorithm.rs#L197)

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

### measure

```rust
fn measure(self: &Self, available: Size, context: &Ref<VirtualizingLayoutContext>, options: FlowLayoutMeasureOptions, callbacks: &dyn IFlowLayoutAlgorithmDelegates) -> Size
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/flow_layout_algorithm.rs#L201)

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

### arrange

```rust
fn arrange(self: &Self, final_size: Size, is_wrapping: bool, alignment: FlowLayoutLineAlignment) -> Size
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/flow_layout_algorithm.rs#L256)

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

### measure_element

```rust
fn measure_element(self: &Self, element: &Ref<Control>, index: i32, available: Size, context: &Ref<VirtualizingLayoutContext>, callbacks: &dyn IFlowLayoutAlgorithmDelegates) -> Size
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/layouts/flow_layout_algorithm.rs#L321)

## 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`
- `Default`

## Availability

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