VirtualizingPanel
struct · ferroui-controls · v0.5.0
struct VirtualizingPanel
Base class for panels that can be used to virtualize items for an
ItemsControl.
Panels should implement the abstract members of this class to provide
virtualization of items in an ItemsControl. Derived panels can
manage scrolling by implementing the logical scrollable contract or by
listening to the effective viewport changed event.
The methods on the ItemContainerGenerator should be used to create,
prepare and clear containers for items.
This class is abstract: its abstract members panic unless overridden.
Members
TYPEto_refscroll_into_viewcontainer_from_indexindex_from_containerget_realized_containersget_control_in_directionon_items_control_changedon_items_changedconstructitem_container_generatoritemsitems_controladd_internal_childinsert_internal_childremove_internal_childremove_internal_child_range
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<VirtualizingPanel>
Returns a strong reference to this object.
scroll_into_view
fn scroll_into_view(self: &Self, index: i32) -> Option<Ref<Control>>
Scrolls the specified item into view.
Returns the element with the specified index, or None if the
element could not be brought into view.
container_from_index
fn container_from_index(self: &Self, index: i32) -> Option<Ref<Control>>
Returns the container for the item at the specified index.
Returns the container for the item at the specified index within
the item collection, if the item is realized; otherwise, None.
Note for implementors: if the item at the specified index is an item-is-self-container item that has previously been realized, then the item should be returned even if it currently falls outside the realized viewport.
index_from_container
fn index_from_container(self: &Self, container: &Ref<Control>) -> i32
Returns the index to the item that has the specified realized container.
Returns the index to the item that corresponds to the specified
realized container, or -1 if container is not found.
get_realized_containers
fn get_realized_containers(self: &Self) -> Option<Vec<Ref<Control>>>
Gets the currently realized containers.
get_control_in_direction
fn get_control_in_direction(self: &Self, direction: NavigationDirection, from: Option<&Ref<InputElement>>, wrap: bool) -> Option<Ref<InputElement>>
Gets the next control in the specified direction.
from is the control from which movement begins and wrap
tells whether to wrap around when the first or last item is
reached.
on_items_control_changed
fn on_items_control_changed(self: &Self, old_value: Option<&Ref<ItemsControl>>)
Called when the ItemsControl that owns the panel changes.
on_items_changed
fn on_items_changed(self: &Self, items: &Rc<ItemsSourceView>, e: &ItemsChangedEventArgs<'_>)
Called when the items collection of the owner ItemsControl
changes.
This method is called a collection changed event is raised by
the items, or when the items property of the items control is
set to a new collection, in which case the action will be a
reset.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
item_container_generator
fn item_container_generator(self: &Self) -> Option<Rc<ItemContainerGenerator>>
Gets the ItemContainerGenerator for this VirtualizingPanel.
items
fn items(self: &Self) -> Rc<ItemsSourceView>
Gets the items to display.
items_control
fn items_control(self: &Self) -> Option<Ref<ItemsControl>>
Gets the ItemsControl that the panel is displaying items for.
add_internal_child
fn add_internal_child(self: &Self, control: &Ref<Control>)
Adds the specified Control to the children collection of a
VirtualizingPanel element.
insert_internal_child
fn insert_internal_child(self: &Self, index: usize, control: &Ref<Control>)
Adds the specified Control to the children collection of a
VirtualizingPanel element at the specified index position.
remove_internal_child
fn remove_internal_child(self: &Self, child: &Ref<Control>)
Removes a child element from the children collection.
remove_internal_child_range
fn remove_internal_child_range(self: &Self, index: usize, count: usize)
Removes child elements from the children collection.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeControlImplExtPanelImplExtVirtualizingPanelImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<VirtualizingPanel>StaticTypeObjectTypeSubclassable<T>FerroObjectImplStyledElementImplVisualImplLayoutableImplInteractiveImplInputElementImplControlImplPanelImplVirtualizingPanelImplINavigableContainer
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.