# ScrollContentPresenter

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

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

```rust
struct ScrollContentPresenter
```

Presents a scrolling view of content inside a [`ScrollViewer`](/docs/0.5.0/api/ferroui-controls/struct-scrollviewer/).

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`can_horizontally_scroll_property`](#function-can_horizontally_scroll_property)
- [`can_vertically_scroll_property`](#function-can_vertically_scroll_property)
- [`extent_property`](#function-extent_property)
- [`offset_property`](#function-offset_property)
- [`viewport_property`](#function-viewport_property)
- [`horizontal_snap_points_type_property`](#function-horizontal_snap_points_type_property)
- [`vertical_snap_points_type_property`](#function-vertical_snap_points_type_property)
- [`horizontal_snap_points_alignment_property`](#function-horizontal_snap_points_alignment_property)
- [`vertical_snap_points_alignment_property`](#function-vertical_snap_points_alignment_property)
- [`is_scroll_chaining_enabled_property`](#function-is_scroll_chaining_enabled_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`can_horizontally_scroll`](#function-can_horizontally_scroll)
- [`set_can_horizontally_scroll`](#function-set_can_horizontally_scroll)
- [`can_vertically_scroll`](#function-can_vertically_scroll)
- [`set_can_vertically_scroll`](#function-set_can_vertically_scroll)
- [`extent`](#function-extent)
- [`offset`](#function-offset)
- [`set_offset`](#function-set_offset)
- [`viewport`](#function-viewport)
- [`horizontal_snap_points_type`](#function-horizontal_snap_points_type)
- [`set_horizontal_snap_points_type`](#function-set_horizontal_snap_points_type)
- [`vertical_snap_points_type`](#function-vertical_snap_points_type)
- [`set_vertical_snap_points_type`](#function-set_vertical_snap_points_type)
- [`horizontal_snap_points_alignment`](#function-horizontal_snap_points_alignment)
- [`set_horizontal_snap_points_alignment`](#function-set_horizontal_snap_points_alignment)
- [`vertical_snap_points_alignment`](#function-vertical_snap_points_alignment)
- [`set_vertical_snap_points_alignment`](#function-set_vertical_snap_points_alignment)
- [`is_scroll_chaining_enabled`](#function-is_scroll_chaining_enabled)
- [`set_is_scroll_chaining_enabled`](#function-set_is_scroll_chaining_enabled)
- [`bring_descendant_into_view`](#function-bring_descendant_into_view)
- [`bring_descendant_into_view_aligned`](#function-bring_descendant_into_view_aligned)
- [`zoom_factor`](#function-zoom_factor)
- [`set_zoom`](#function-set_zoom)

<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/presenters/scroll_content_presenter.rs#L69)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L69)

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

### can_horizontally_scroll_property

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

Defines the `CanHorizontallyScroll` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L348)

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

### can_vertically_scroll_property

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

Defines the `CanVerticallyScroll` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L348)

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

### extent_property

```rust
fn extent_property() -> &'static DirectProperty<ScrollContentPresenter, Size>
```

Defines the `Extent` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L348)

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

### offset_property

```rust
fn offset_property() -> &'static StyledProperty<Vector>
```

Defines the `Offset` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L348)

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

### viewport_property

```rust
fn viewport_property() -> &'static DirectProperty<ScrollContentPresenter, Size>
```

Defines the `Viewport` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L348)

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

### horizontal_snap_points_type_property

```rust
fn horizontal_snap_points_type_property() -> &'static AttachedProperty<SnapPointsType>
```

Defines the `HorizontalSnapPointsType` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L348)

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

### vertical_snap_points_type_property

```rust
fn vertical_snap_points_type_property() -> &'static AttachedProperty<SnapPointsType>
```

Defines the `VerticalSnapPointsType` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L348)

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

### horizontal_snap_points_alignment_property

```rust
fn horizontal_snap_points_alignment_property() -> &'static AttachedProperty<SnapPointsAlignment>
```

Defines the `HorizontalSnapPointsAlignment` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L348)

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

### vertical_snap_points_alignment_property

```rust
fn vertical_snap_points_alignment_property() -> &'static AttachedProperty<SnapPointsAlignment>
```

Defines the `VerticalSnapPointsAlignment` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L348)

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

### is_scroll_chaining_enabled_property

```rust
fn is_scroll_chaining_enabled_property() -> &'static AttachedProperty<bool>
```

Defines the `IsScrollChainingEnabled` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L348)

<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/presenters/scroll_content_presenter.rs#L436)

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

### new

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

Initializes a new instance of the class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L467)

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

### can_horizontally_scroll

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

Gets a value indicating whether the content can be scrolled
horizontally.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L473)

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

### set_can_horizontally_scroll

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

Sets a value indicating whether the content can be scrolled
horizontally.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L479)

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

### can_vertically_scroll

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

Gets a value indicating whether the content can be scrolled
vertically.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L485)

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

### set_can_vertically_scroll

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

Sets a value indicating whether the content can be scrolled
vertically.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L491)

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

### extent

```rust
fn extent(self: &Self) -> Size
```

Gets the extent of the scrollable content.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L496)

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

### offset

```rust
fn offset(self: &Self) -> Vector
```

Gets the current scroll offset.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L505)

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

### set_offset

```rust
fn set_offset(self: &Self, value: Vector)
```

Sets the current scroll offset.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L510)

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

### viewport

```rust
fn viewport(self: &Self) -> Size
```

Gets the size of the viewport on the scrollable content.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L515)

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

### horizontal_snap_points_type

```rust
fn horizontal_snap_points_type(self: &Self) -> SnapPointsType
```

Gets how scroll gesture reacts to the snap points along the
horizontal axis.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L525)

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

### set_horizontal_snap_points_type

```rust
fn set_horizontal_snap_points_type(self: &Self, value: SnapPointsType)
```

Sets how scroll gesture reacts to the snap points along the
horizontal axis.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L531)

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

### vertical_snap_points_type

```rust
fn vertical_snap_points_type(self: &Self) -> SnapPointsType
```

Gets how scroll gesture reacts to the snap points along the vertical
axis.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L537)

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

### set_vertical_snap_points_type

```rust
fn set_vertical_snap_points_type(self: &Self, value: SnapPointsType)
```

Sets how scroll gesture reacts to the snap points along the vertical
axis.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L543)

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

### horizontal_snap_points_alignment

```rust
fn horizontal_snap_points_alignment(self: &Self) -> SnapPointsAlignment
```

Gets how the existing snap points are horizontally aligned versus the
initial viewport.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L549)

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

### set_horizontal_snap_points_alignment

```rust
fn set_horizontal_snap_points_alignment(self: &Self, value: SnapPointsAlignment)
```

Sets how the existing snap points are horizontally aligned versus the
initial viewport.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L555)

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

### vertical_snap_points_alignment

```rust
fn vertical_snap_points_alignment(self: &Self) -> SnapPointsAlignment
```

Gets how the existing snap points are vertically aligned versus the
initial viewport.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L561)

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

### set_vertical_snap_points_alignment

```rust
fn set_vertical_snap_points_alignment(self: &Self, value: SnapPointsAlignment)
```

Sets how the existing snap points are vertically aligned versus the
initial viewport.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L567)

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

### is_scroll_chaining_enabled

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

Gets if scroll chaining is enabled. The default value is true.

After a user hits a scroll limit on an element that has been nested
within another scrollable element, you can specify whether that
parent element should continue the scrolling operation begun in its
child element. This is called scroll chaining.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L577)

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

### set_is_scroll_chaining_enabled

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

Sets if scroll chaining is enabled.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L582)

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

### bring_descendant_into_view

```rust
fn bring_descendant_into_view(self: &Self, target: &Visual, target_rect: Rect) -> bool
```

Attempts to bring a portion of the target visual into view by
scrolling the content.

`target` is the target visual and `target_rect` the portion of the
target visual to bring into view. Returns true if the scroll offset
was changed; otherwise false.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L596)

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

### bring_descendant_into_view_aligned

```rust
fn bring_descendant_into_view_aligned(self: &Self, target: &Visual, target_rect: Rect, align_to_top: bool) -> bool
```

Brings a descendant rectangle to the top or bottom of the viewport.
This uses extent coordinates, so repeated requests remain correct before
the next arrange pass applies a changed offset. Logical scrolling stays
delegated to the content's own scrolling contract.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L604)

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

### zoom_factor

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

The zoom of the content: 1 unless the scroll viewer was zoomed (not upstream).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L938)

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

### set_zoom

```rust
fn set_zoom(self: &Self, zoom: f64, offset: Vector)
```

Zooms the content to `zoom` and scrolls to `offset` (in zoomed units), as the
`ChangeView` of WinUI's scroll viewer does (not upstream). The content keeps its layout:
the presenter scales it (`Visual::manipulation_transform`) and the extent is its zoomed
size. A content that scrolls logically (a virtualizing panel) is not zoomed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/presenters/scroll_content_presenter.rs#L952)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- `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<ScrollContentPresenter>`](/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/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`IScrollable`](/docs/0.5.0/api/ferroui-base/input/trait-iscrollable/)
- [`IScrollAnchorProvider`](/docs/0.5.0/api/ferroui-controls/trait-iscrollanchorprovider/)

## Availability

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