FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ScrollViewer

    struct · ferroui-controls · v0.5.0

    struct ScrollViewer
    

    A control which scrolls its content if the content is bigger than the space available.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<ScrollViewer>
    

    Returns a strong reference to this object.

    Source

    on_scroll_changed

    fn on_scroll_changed(self: &Self, e: &ScrollChangedEventArgs)
    

    Called when a change in scrolling state is detected, such as a change in scroll position, extent, or viewport size.

    If you override this method, call the parent implementation to ensure that the ScrollChanged event is raised.

    Source

    TEMPLATE_PARTS

    const TEMPLATE_PARTS: &'static [TemplatePartAttribute]
    

    The named parts expected in the control template, in addition to those of the base class.

    Source

    bring_into_view_on_focus_change_property

    fn bring_into_view_on_focus_change_property() -> &'static AttachedProperty<bool>
    

    Defines the BringIntoViewOnFocusChange property.

    Source

    extent_property

    fn extent_property() -> &'static DirectProperty<ScrollViewer, Size>
    

    Defines the Extent property.

    Source

    offset_property

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

    Defines the Offset property.

    Source

    zoom_mode_property

    fn zoom_mode_property() -> &'static StyledProperty<ZoomMode>
    

    Defines the ZoomMode property (WinUI ScrollViewer.ZoomMode, not upstream): whether the user can zoom the content.

    Source

    min_zoom_factor_property

    fn min_zoom_factor_property() -> &'static StyledProperty<f32>
    

    Defines the MinZoomFactor property (WinUI, not upstream).

    Source

    max_zoom_factor_property

    fn max_zoom_factor_property() -> &'static StyledProperty<f32>
    

    Defines the MaxZoomFactor property (WinUI, not upstream).

    Source

    zoom_factor_property

    fn zoom_factor_property() -> &'static DirectProperty<ScrollViewer, f32>
    

    Defines the ZoomFactor property (WinUI, not upstream): the zoom of the content, changed with change_view or by the user.

    Source

    viewport_property

    fn viewport_property() -> &'static DirectProperty<ScrollViewer, Size>
    

    Defines the Viewport property.

    Source

    large_change_property

    fn large_change_property() -> &'static DirectProperty<ScrollViewer, Size>
    

    Defines the LargeChange property.

    Source

    small_change_property

    fn small_change_property() -> &'static DirectProperty<ScrollViewer, Size>
    

    Defines the SmallChange property.

    Source

    scroll_bar_maximum_property

    fn scroll_bar_maximum_property() -> &'static DirectProperty<ScrollViewer, Vector>
    

    Defines the ScrollBarMaximum property.

    Source

    horizontal_scroll_bar_visibility_property

    fn horizontal_scroll_bar_visibility_property() -> &'static AttachedProperty<ScrollBarVisibility>
    

    Defines the HorizontalScrollBarVisibility property.

    Source

    horizontal_snap_points_type_property

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

    Defines the HorizontalSnapPointsType property.

    Source

    vertical_snap_points_type_property

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

    Defines the VerticalSnapPointsType property.

    Source

    horizontal_snap_points_alignment_property

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

    Defines the HorizontalSnapPointsAlignment property.

    Source

    vertical_snap_points_alignment_property

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

    Defines the VerticalSnapPointsAlignment property.

    Source

    vertical_scroll_bar_visibility_property

    fn vertical_scroll_bar_visibility_property() -> &'static AttachedProperty<ScrollBarVisibility>
    

    Defines the VerticalScrollBarVisibility property.

    Source

    is_expanded_property

    fn is_expanded_property() -> &'static DirectProperty<ScrollViewer, bool>
    

    Defines the IsExpanded property.

    Source

    allow_auto_hide_property

    fn allow_auto_hide_property() -> &'static AttachedProperty<bool>
    

    Defines the AllowAutoHide property.

    Source

    is_scroll_chaining_enabled_property

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

    Defines the IsScrollChainingEnabled property.

    Source

    is_scroll_inertia_enabled_property

    fn is_scroll_inertia_enabled_property() -> &'static AttachedProperty<bool>
    

    Defines the IsScrollInertiaEnabled property.

    Source

    is_deferred_scrolling_enabled_property

    fn is_deferred_scrolling_enabled_property() -> &'static AttachedProperty<bool>
    

    Defines the IsDeferredScrollingEnabled property.

    Source

    scroll_changed_event

    fn scroll_changed_event() -> &'static RoutedEvent<ScrollChangedEventArgs>
    

    Defines the ScrollChanged event.

    Source

    construct

    fn construct() -> Self
    

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

    Source

    new

    fn new() -> Ref<Self>
    

    Initializes a new instance of the class.

    Source

    scroll_changed

    fn scroll_changed(self: &Self, handler: impl Fn(&Interactive, &ScrollChangedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
    

    Occurs when changes are detected to the scroll position, extent, or viewport size.

    Source

    bring_into_view_on_focus_change

    fn bring_into_view_on_focus_change(self: &Self) -> bool
    

    Gets a value that determines whether the scroll viewer uses a bring-into-view scroll behavior when an item in the view gets focus.

    True to use a behavior that brings focused items into view. False to use a behavior that focused items do not automatically scroll into view. The default is true.

    The value can either be set explicitly on a scroll viewer, or the attached ScrollViewer.BringIntoViewOnFocusChange property can be set on an element that hosts a scroll viewer.

    Source

    set_bring_into_view_on_focus_change

    fn set_bring_into_view_on_focus_change(self: &Self, value: bool)
    

    Sets a value that determines whether the scroll viewer uses a bring-into-view scroll behavior when an item in the view gets focus.

    Source

    extent

    fn extent(self: &Self) -> Size
    

    Gets the extent of the scrollable content.

    Source

    offset

    fn offset(self: &Self) -> Vector
    

    Gets the current scroll offset.

    Source

    set_offset

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

    Sets the current scroll offset.

    Source

    viewport

    fn viewport(self: &Self) -> Size
    

    Gets the size of the viewport on the scrollable content.

    Source

    zoom_mode

    fn zoom_mode(self: &Self) -> ZoomMode
    

    ZoomMode: whether the user can zoom the content (Ctrl and the mouse wheel); a zoom asked for by change_view is applied either way.

    Source

    set_zoom_mode

    fn set_zoom_mode(self: &Self, value: ZoomMode)
    

    Source

    min_zoom_factor

    fn min_zoom_factor(self: &Self) -> f32
    

    MinZoomFactor (default 0.1).

    Source

    set_min_zoom_factor

    fn set_min_zoom_factor(self: &Self, value: f32)
    

    Source

    max_zoom_factor

    fn max_zoom_factor(self: &Self) -> f32
    

    MaxZoomFactor (default 10).

    Source

    set_max_zoom_factor

    fn set_max_zoom_factor(self: &Self, value: f32)
    

    Source

    zoom_factor

    fn zoom_factor(self: &Self) -> f32
    

    ZoomFactor: the zoom of the content (1 unless it was zoomed). The content keeps its layout and is scaled about its top left corner; the extent and the offsets are in zoomed units, as in WinUI.

    Source

    change_view

    fn change_view(self: &Self, horizontal_offset: Option<f64>, vertical_offset: Option<f64>, zoom_factor: Option<f32>) -> bool
    

    ChangeView(horizontalOffset, verticalOffset, zoomFactor): scrolls and zooms the content to the values given (None keeps the current one); the zoom factor is kept between the minimum and the maximum, the offsets within the extent at that zoom. Returns false when the scroll viewer has no scroll presenter to change.

    Deviation (winui-composition.md): the change is applied at once; WinUI animates it unless disableAnimation (see change_view_with).

    Source

    change_view_with

    fn change_view_with(self: &Self, horizontal_offset: Option<f64>, vertical_offset: Option<f64>, zoom_factor: Option<f32>, _disable_animation: bool) -> bool
    

    ChangeView(horizontalOffset, verticalOffset, zoomFactor, disableAnimation).

    Source

    zoom_to_factor

    fn zoom_to_factor(self: &Self, factor: f32)
    

    ZoomToFactor(factor) (deprecated in WinUI for ChangeView): zooms to factor, keeping the offsets.

    Source

    large_change

    fn large_change(self: &Self) -> Size
    

    Gets the large (page) change value for the scroll viewer.

    Source

    small_change

    fn small_change(self: &Self) -> Size
    

    Gets the small (line) change value for the scroll viewer.

    Source

    horizontal_scroll_bar_visibility

    fn horizontal_scroll_bar_visibility(self: &Self) -> ScrollBarVisibility
    

    Gets the horizontal scrollbar visibility.

    Source

    set_horizontal_scroll_bar_visibility

    fn set_horizontal_scroll_bar_visibility(self: &Self, value: ScrollBarVisibility)
    

    Sets the horizontal scrollbar visibility.

    Source

    vertical_scroll_bar_visibility

    fn vertical_scroll_bar_visibility(self: &Self) -> ScrollBarVisibility
    

    Gets the vertical scrollbar visibility.

    Source

    set_vertical_scroll_bar_visibility

    fn set_vertical_scroll_bar_visibility(self: &Self, value: ScrollBarVisibility)
    

    Sets the vertical scrollbar visibility.

    Source

    can_horizontally_scroll

    fn can_horizontally_scroll(self: &Self) -> bool
    

    Gets a value indicating whether the viewer can scroll horizontally.

    Source

    can_vertically_scroll

    fn can_vertically_scroll(self: &Self) -> bool
    

    Gets a value indicating whether the viewer can scroll vertically.

    Source

    current_anchor

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

    The currently chosen anchor element to use for scroll anchoring.

    Source

    scroll_bar_maximum

    fn scroll_bar_maximum(self: &Self) -> Vector
    

    Gets the maximum scrolling distance (which is the extent minus the viewport).

    Source

    is_expanded

    fn is_expanded(self: &Self) -> bool
    

    Gets a value that indicates whether any scrollbar is expanded.

    Source

    horizontal_snap_points_type

    fn horizontal_snap_points_type(self: &Self) -> SnapPointsType
    

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

    Source

    set_horizontal_snap_points_type

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

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

    Source

    vertical_snap_points_type

    fn vertical_snap_points_type(self: &Self) -> SnapPointsType
    

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

    Source

    set_vertical_snap_points_type

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

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

    Source

    horizontal_snap_points_alignment

    fn horizontal_snap_points_alignment(self: &Self) -> SnapPointsAlignment
    

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

    Source

    set_horizontal_snap_points_alignment

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

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

    Source

    vertical_snap_points_alignment

    fn vertical_snap_points_alignment(self: &Self) -> SnapPointsAlignment
    

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

    Source

    set_vertical_snap_points_alignment

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

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

    Source

    allow_auto_hide

    fn allow_auto_hide(self: &Self) -> bool
    

    Gets a value that indicates whether scrollbars can hide itself when user is not interacting with it.

    Source

    set_allow_auto_hide

    fn set_allow_auto_hide(self: &Self, value: bool)
    

    Sets a value that indicates whether scrollbars can hide itself when user is not interacting with it.

    Source

    is_scroll_chaining_enabled

    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

    set_is_scroll_chaining_enabled

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

    Sets if scroll chaining is enabled.

    Source

    is_scroll_inertia_enabled

    fn is_scroll_inertia_enabled(self: &Self) -> bool
    

    Gets whether scroll gestures should include inertia in their behavior and value.

    Source

    set_is_scroll_inertia_enabled

    fn set_is_scroll_inertia_enabled(self: &Self, value: bool)
    

    Sets whether scroll gestures should include inertia in their behavior and value.

    Source

    is_deferred_scrolling_enabled

    fn is_deferred_scrolling_enabled(self: &Self) -> bool
    

    Gets whether dragging of thumb elements should update the scroll viewer only when the user releases the mouse.

    Source

    set_is_deferred_scrolling_enabled

    fn set_is_deferred_scrolling_enabled(self: &Self, value: bool)
    

    Sets whether dragging of thumb elements should update the scroll viewer only when the user releases the mouse.

    Source

    line_up

    fn line_up(self: &Self)
    

    Scrolls the content up one line.

    Source

    line_down

    fn line_down(self: &Self)
    

    Scrolls the content down one line.

    Source

    line_left

    fn line_left(self: &Self)
    

    Scrolls the content left one line.

    Source

    line_right

    fn line_right(self: &Self)
    

    Scrolls the content right one line.

    Source

    page_up

    fn page_up(self: &Self)
    

    Scrolls the content upward by one page.

    Source

    page_down

    fn page_down(self: &Self)
    

    Scrolls the content downward by one page.

    Source

    page_left

    fn page_left(self: &Self)
    

    Scrolls the content left by one page.

    Source

    page_right

    fn page_right(self: &Self)
    

    Scrolls the content right by one page.

    Source

    scroll_to_home

    fn scroll_to_home(self: &Self)
    

    Scrolls to the top-left corner of the content.

    Source

    scroll_to_end

    fn scroll_to_end(self: &Self)
    

    Scrolls to the bottom-left corner of the content.

    Source

    get_bring_into_view_on_focus_change

    fn get_bring_into_view_on_focus_change(control: &Control) -> bool
    

    Gets the value of the BringIntoViewOnFocusChange attached property of control.

    Source

    set_bring_into_view_on_focus_change_on

    fn set_bring_into_view_on_focus_change_on(control: &Control, value: bool)
    

    Sets the value of the BringIntoViewOnFocusChange attached property on control.

    Source

    get_horizontal_scroll_bar_visibility

    fn get_horizontal_scroll_bar_visibility(control: &Control) -> ScrollBarVisibility
    

    Gets the value of the HorizontalScrollBarVisibility attached property of control.

    Source

    set_horizontal_scroll_bar_visibility_on

    fn set_horizontal_scroll_bar_visibility_on(control: &Control, value: ScrollBarVisibility)
    

    Sets the value of the HorizontalScrollBarVisibility attached property on control.

    Source

    get_horizontal_snap_points_type

    fn get_horizontal_snap_points_type(control: &Control) -> SnapPointsType
    

    Gets the value of the HorizontalSnapPointsType attached property of control.

    Source

    set_horizontal_snap_points_type_on

    fn set_horizontal_snap_points_type_on(control: &Control, value: SnapPointsType)
    

    Sets the value of the HorizontalSnapPointsType attached property on control.

    Source

    get_vertical_snap_points_type

    fn get_vertical_snap_points_type(control: &Control) -> SnapPointsType
    

    Gets the value of the VerticalSnapPointsType attached property of control.

    Source

    set_vertical_snap_points_type_on

    fn set_vertical_snap_points_type_on(control: &Control, value: SnapPointsType)
    

    Sets the value of the VerticalSnapPointsType attached property on control.

    Source

    get_horizontal_snap_points_alignment

    fn get_horizontal_snap_points_alignment(control: &Control) -> SnapPointsAlignment
    

    Gets the value of the HorizontalSnapPointsAlignment attached property of control.

    Source

    set_horizontal_snap_points_alignment_on

    fn set_horizontal_snap_points_alignment_on(control: &Control, value: SnapPointsAlignment)
    

    Sets the value of the HorizontalSnapPointsAlignment attached property on control.

    Source

    get_vertical_snap_points_alignment

    fn get_vertical_snap_points_alignment(control: &Control) -> SnapPointsAlignment
    

    Gets the value of the VerticalSnapPointsAlignment attached property of control.

    Source

    set_vertical_snap_points_alignment_on

    fn set_vertical_snap_points_alignment_on(control: &Control, value: SnapPointsAlignment)
    

    Sets the value of the VerticalSnapPointsAlignment attached property on control.

    Source

    get_vertical_scroll_bar_visibility

    fn get_vertical_scroll_bar_visibility(control: &Control) -> ScrollBarVisibility
    

    Gets the value of the VerticalScrollBarVisibility attached property of control.

    Source

    set_allow_auto_hide_on

    fn set_allow_auto_hide_on(control: &Control, value: bool)
    

    Sets the value of the AllowAutoHide attached property on control.

    Source

    get_allow_auto_hide

    fn get_allow_auto_hide(control: &Control) -> bool
    

    Gets the value of the AllowAutoHide attached property of control.

    Source

    set_is_scroll_chaining_enabled_on

    fn set_is_scroll_chaining_enabled_on(control: &Control, value: bool)
    

    Sets the value of the IsScrollChainingEnabled attached property on control.

    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

    get_is_scroll_chaining_enabled

    fn get_is_scroll_chaining_enabled(control: &Control) -> bool
    

    Gets the value of the IsScrollChainingEnabled attached property of control.

    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

    set_vertical_scroll_bar_visibility_on

    fn set_vertical_scroll_bar_visibility_on(control: &Control, value: ScrollBarVisibility)
    

    Sets the value of the VerticalScrollBarVisibility attached property on control.

    Source

    get_is_scroll_inertia_enabled

    fn get_is_scroll_inertia_enabled(control: &Control) -> bool
    

    Gets whether scroll gestures should include inertia in their behavior and value.

    Source

    set_is_scroll_inertia_enabled_on

    fn set_is_scroll_inertia_enabled_on(control: &Control, value: bool)
    

    Sets whether scroll gestures should include inertia in their behavior and value.

    Source

    get_is_deferred_scrolling_enabled

    fn get_is_deferred_scrolling_enabled(control: &Control) -> bool
    

    Gets whether dragging of thumb elements should update the scroll viewer only when the user releases the mouse.

    Source

    set_is_deferred_scrolling_enabled_on

    fn set_is_deferred_scrolling_enabled_on(control: &Control, value: bool)
    

    Sets whether dragging of thumb elements should update the scroll viewer only when the user releases the mouse.

    Source

    register_anchor_candidate

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

    Registers a control as a potential scroll anchor candidate.

    Source

    unregister_anchor_candidate

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

    Unregisters a control as a potential scroll anchor candidate.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.