# VirtualizingStackPanel

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

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

```rust
struct VirtualizingStackPanel
```

Arranges and virtualizes content on a single line that is oriented either
horizontally or vertically.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`orientation_property`](#function-orientation_property)
- [`are_horizontal_snap_points_regular_property`](#function-are_horizontal_snap_points_regular_property)
- [`are_vertical_snap_points_regular_property`](#function-are_vertical_snap_points_regular_property)
- [`horizontal_snap_points_changed_event`](#function-horizontal_snap_points_changed_event)
- [`vertical_snap_points_changed_event`](#function-vertical_snap_points_changed_event)
- [`cache_length_property`](#function-cache_length_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`orientation`](#function-orientation)
- [`set_orientation`](#function-set_orientation)
- [`horizontal_snap_points_changed`](#function-horizontal_snap_points_changed)
- [`vertical_snap_points_changed`](#function-vertical_snap_points_changed)
- [`are_horizontal_snap_points_regular`](#function-are_horizontal_snap_points_regular)
- [`set_are_horizontal_snap_points_regular`](#function-set_are_horizontal_snap_points_regular)
- [`are_vertical_snap_points_regular`](#function-are_vertical_snap_points_regular)
- [`set_are_vertical_snap_points_regular`](#function-set_are_vertical_snap_points_regular)
- [`cache_length`](#function-cache_length)
- [`set_cache_length`](#function-set_cache_length)
- [`first_realized_index`](#function-first_realized_index)
- [`last_realized_index`](#function-last_realized_index)
- [`get_irregular_snap_points`](#function-get_irregular_snap_points)
- [`get_regular_snap_points`](#function-get_regular_snap_points)

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

### TYPE

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

The runtime type of this class.

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

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<VirtualizingStackPanel>
```

Returns a strong reference to this object.

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

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

### orientation_property

```rust
fn orientation_property() -> &'static StyledProperty<Orientation>
```

Defines the `Orientation` property.

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

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

### are_horizontal_snap_points_regular_property

```rust
fn are_horizontal_snap_points_regular_property() -> &'static StyledProperty<bool>
```

Defines the `AreHorizontalSnapPointsRegular` property.

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

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

### are_vertical_snap_points_regular_property

```rust
fn are_vertical_snap_points_regular_property() -> &'static StyledProperty<bool>
```

Defines the `AreVerticalSnapPointsRegular` property.

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

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

### horizontal_snap_points_changed_event

```rust
fn horizontal_snap_points_changed_event() -> &'static RoutedEvent<RoutedEventArgs>
```

Defines the `HorizontalSnapPointsChanged` event.

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

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

### vertical_snap_points_changed_event

```rust
fn vertical_snap_points_changed_event() -> &'static RoutedEvent<RoutedEventArgs>
```

Defines the `VerticalSnapPointsChanged` event.

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

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

### cache_length_property

```rust
fn cache_length_property() -> &'static StyledProperty<f64>
```

Defines the `CacheLength` property.

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

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

### construct

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

Creates the class data; see `ferroui_base::FerroObject::construct`.

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

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

### new

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



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

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

### orientation

```rust
fn orientation(self: &Self) -> Orientation
```

Gets or sets the axis along which items are laid out.

One of the enumeration values that specifies the axis along which
items are laid out. The default is vertical.

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

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

### set_orientation

```rust
fn set_orientation(self: &Self, value: Orientation)
```



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

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

### horizontal_snap_points_changed

```rust
fn horizontal_snap_points_changed(self: &Self, handler: impl Fn(&Interactive, &RoutedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
```

Occurs when the measurements for horizontal snap points change.

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

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

### vertical_snap_points_changed

```rust
fn vertical_snap_points_changed(self: &Self, handler: impl Fn(&Interactive, &RoutedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
```

Occurs when the measurements for vertical snap points change.

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

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

### are_horizontal_snap_points_regular

```rust
fn are_horizontal_snap_points_regular(self: &Self) -> bool
```

Gets or sets whether the horizontal snap points for the
`VirtualizingStackPanel` are equidistant from each other.

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

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

### set_are_horizontal_snap_points_regular

```rust
fn set_are_horizontal_snap_points_regular(self: &Self, value: bool)
```



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

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

### are_vertical_snap_points_regular

```rust
fn are_vertical_snap_points_regular(self: &Self) -> bool
```

Gets or sets whether the vertical snap points for the
`VirtualizingStackPanel` are equidistant from each other.

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

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

### set_are_vertical_snap_points_regular

```rust
fn set_are_vertical_snap_points_regular(self: &Self, value: bool)
```



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

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

### cache_length

```rust
fn cache_length(self: &Self) -> f64
```

Gets or sets the cache length.

The factor determines how much additional space to maintain above and
below the viewport. A value of 0.5 means half the viewport size will
be buffered on each side (up-down or left-right). This uses more
memory as more UI elements are realized, but greatly reduces the
number of measure-arrange cycles which can cause heavy memory
pressure depending on the complexity of the item layouts.

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

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

### set_cache_length

```rust
fn set_cache_length(self: &Self, value: f64)
```



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

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

### first_realized_index

```rust
fn first_realized_index(self: &Self) -> i32
```

Gets the index of the first realized element, or -1 if no elements
are realized.

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

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

### last_realized_index

```rust
fn last_realized_index(self: &Self) -> i32
```

Gets the index of the last realized element, or -1 if no elements are
realized.

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

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

### get_irregular_snap_points

```rust
fn get_irregular_snap_points(self: &Self, orientation: Orientation, snap_points_alignment: SnapPointsAlignment) -> Vec<f64>
```

Returns the set of distances between irregular snap points for a
specified orientation and alignment.

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

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

### get_regular_snap_points

```rust
fn get_regular_snap_points(self: &Self, _orientation: Orientation, snap_points_alignment: SnapPointsAlignment) -> (f64, f64)
```

Gets the distance between regular snap points for a specified
orientation and alignment, and the offset of the first snap point.

Panics if the snap points of the panel's orientation are not regular.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- [`PanelImplExt`](/docs/0.5.0/api/ferroui-controls/trait-panelimplext/)
- [`VirtualizingPanelImplExt`](/docs/0.5.0/api/ferroui-controls/trait-virtualizingpanelimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<VirtualizingStackPanel>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`PanelImpl`](/docs/0.5.0/api/ferroui-controls/trait-panelimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`VirtualizingPanelImpl`](/docs/0.5.0/api/ferroui-controls/trait-virtualizingpanelimpl/)
- [`IScrollSnapPointsInfo`](/docs/0.5.0/api/ferroui-controls/primitives/trait-iscrollsnappointsinfo/)

## Availability

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