# IScrollAnchorProvider

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

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

```rust
trait IScrollAnchorProvider
```

Specifies a contract for a scrolling control that supports scroll
anchoring.

A class implementing the trait is made known with
[`register_scroll_anchor_provider`](/docs/0.5.0/api/ferroui-controls/function-register_scroll_anchor_provider/), normally from its class
initialization; [`as_scroll_anchor_provider`](/docs/0.5.0/api/ferroui-controls/function-as_scroll_anchor_provider/) 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_scroll_anchor_provider.rs#L12)

## Members

- [`current_anchor`](#function-current_anchor)
- [`register_anchor_candidate`](#function-register_anchor_candidate)
- [`unregister_anchor_candidate`](#function-unregister_anchor_candidate)

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

### current_anchor

```rust
fn current_anchor(self: &Self) -> Option<Ref<Control>>
```

The currently chosen anchor element to use for scroll anchoring.

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

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

### register_anchor_candidate

```rust
fn register_anchor_candidate(self: &Self, element: &Ref<Control>)
```

Registers a control as a potential scroll anchor candidate.

`element` is a control within the subtree of the provider.

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

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

### unregister_anchor_candidate

```rust
fn unregister_anchor_candidate(self: &Self, element: &Ref<Control>)
```

Unregisters a control as a potential scroll anchor candidate.

`element` is a control within the subtree of the provider.

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

## Trait implementations

- [`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/).
