FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ItemsControl

    struct · ferroui-controls · v0.5.0

    struct ItemsControl
    

    Displays a collection of items.

    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<ItemsControl>
    

    Returns a strong reference to this object.

    Source

    create_container_for_item_override

    fn create_container_for_item_override(self: &Self, item: &Option<BoxedValue>, index: i32, recycle_key: Option<RecycleKey>) -> Ref<Control>
    

    Creates or a container that can be used to display an item.

    Source

    prepare_container_for_item_override

    fn prepare_container_for_item_override(self: &Self, container: &Ref<Control>, item: &Option<BoxedValue>, index: i32)
    

    Prepares the specified element to display the specified item.

    Source

    container_for_item_prepared_override

    fn container_for_item_prepared_override(self: &Self, container: &Ref<Control>, item: &Option<BoxedValue>, index: i32)
    

    Called when a container has been fully prepared to display an item.

    This method will be called when a container has been fully prepared and added to the logical and visual trees, but may be called before a layout pass has completed. It is called immediately before the container_prepared event is raised.

    Source

    container_index_changed_override

    fn container_index_changed_override(self: &Self, container: &Ref<Control>, old_index: i32, new_index: i32)
    

    Called when the index for a container changes due to an insertion or removal in the items collection.

    Source

    clear_container_for_item_override

    fn clear_container_for_item_override(self: &Self, container: &Ref<Control>)
    

    Undoes the effects of the prepare_container_for_item_override method.

    Source

    needs_container_override

    fn needs_container_override(self: &Self, item: &Option<BoxedValue>, index: i32) -> (bool, Option<RecycleKey>)
    

    Determines whether the specified item can be its own container.

    Returns true if the item needs a container; otherwise false if the item can itself be used as a container. The second value is a key that can be used to locate a previously recycled container of the correct type, or None if the item cannot be recycled. If the item is its own container then by definition it cannot be recycled, so the key should be None.

    Source

    on_items_view_collection_changed

    fn on_items_view_collection_changed(self: &Self, e: &ItemsChangedEventArgs<'_>)
    

    Called when the collection changed event is raised on the items view.

    Source

    PSEUDO_CLASSES

    const PSEUDO_CLASSES: PseudoClassesAttribute
    

    The pseudoclasses set by the class.

    Source

    item_container_theme_property

    fn item_container_theme_property() -> &'static StyledProperty<Option<Ref<ControlTheme>>>
    

    Defines the ItemContainerTheme property.

    Source

    item_count_property

    fn item_count_property() -> &'static DirectProperty<ItemsControl, i32>
    

    Defines the ItemCount property.

    Source

    items_panel_property

    fn items_panel_property() -> &'static StyledProperty<Rc<dyn ITemplateOf<Option<Ref<Panel>>>>>
    

    Defines the ItemsPanel property.

    Source

    items_source_property

    fn items_source_property() -> &'static StyledProperty<Option<ItemsSource>>
    

    Defines the ItemsSource property.

    Source

    item_template_property

    fn item_template_property() -> &'static StyledProperty<Option<Rc<dyn IDataTemplate>>>
    

    Defines the ItemTemplate property.

    Source

    display_member_binding_property

    fn display_member_binding_property() -> &'static StyledProperty<Option<AssignedBinding>>
    

    Defines the DisplayMemberBinding property.

    Source

    construct

    fn construct() -> Self
    

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

    Source

    new

    fn new() -> Ref<Self>
    

    Source

    display_member_binding

    fn display_member_binding(self: &Self) -> Option<AssignedBinding>
    

    Gets or sets the binding to use for binding to the display member of each item.

    Source

    set_display_member_binding

    fn set_display_member_binding(self: &Self, value: Option<AssignedBinding>)
    

    Source

    item_container_generator

    fn item_container_generator(self: &Self) -> Rc<ItemContainerGenerator>
    

    Gets the ItemContainerGenerator for the control.

    Source

    items

    fn items(self: &Self) -> ItemCollection
    

    Gets the items to display.

    You use either the items or the items_source property to specify the collection that should be used to generate the content of your ItemsControl. When the items_source property is set, the items collection is made read-only and fixed-size.

    When items_source is in use, setting the items_source property to None removes the collection and restores usage to items, which will be an empty ItemCollection.

    Source

    item_container_theme

    fn item_container_theme(self: &Self) -> Option<Ref<ControlTheme>>
    

    Gets or sets the ControlTheme that is applied to the container element generated for each item.

    Source

    set_item_container_theme

    fn set_item_container_theme(self: &Self, value: Option<Ref<ControlTheme>>)
    

    Source

    item_count

    fn item_count(self: &Self) -> i32
    

    Gets the number of items being displayed by the ItemsControl.

    Source

    items_panel

    fn items_panel(self: &Self) -> Rc<dyn ITemplateOf<Option<Ref<Panel>>>>
    

    Gets or sets the panel used to display the items.

    Source

    set_items_panel

    fn set_items_panel(self: &Self, value: Rc<dyn ITemplateOf<Option<Ref<Panel>>>>)
    

    Source

    items_source

    fn items_source(self: &Self) -> Option<ItemsSource>
    

    Gets or sets a collection used to generate the content of the ItemsControl.

    A common scenario is to use an ItemsControl such as a list box to display a data collection, or to bind an ItemsControl to a collection object. To bind an ItemsControl to a collection object, use the items_source property.

    When the items_source property is set, the items collection is made read-only and fixed-size.

    When items_source is in use, setting the property to None removes the collection and restores usage to items, which will be an empty ItemCollection.

    Source

    set_items_source

    fn set_items_source(self: &Self, value: Option<ItemsSource>)
    

    Source

    item_template

    fn item_template(self: &Self) -> Option<Rc<dyn IDataTemplate>>
    

    Gets or sets the data template used to display the items in the control.

    Source

    set_item_template

    fn set_item_template(self: &Self, value: Option<Rc<dyn IDataTemplate>>)
    

    Source

    presenter

    fn presenter(self: &Self) -> Option<Ref<ItemsPresenter>>
    

    Gets the items presenter control.

    Source

    items_panel_root

    fn items_panel_root(self: &Self) -> Option<Ref<Panel>>
    

    Gets the Panel specified by items_panel.

    Source

    items_view

    fn items_view(self: &Self) -> &Rc<ItemsSourceView>
    

    Gets a read-only view of the items in the ItemsControl.

    Source

    wrap_focus

    fn wrap_focus(self: &Self) -> bool
    

    Whether directional navigation wraps around at the first and last items.

    Source

    set_wrap_focus

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

    Source

    preparing_container

    fn preparing_container(self: &Self, handler: impl Fn(&ContainerPreparedEventArgs) -> () + 'static) -> Subscription
    

    Occurs immediately before a container is prepared for use.

    The prepared element might be newly created or an existing container that is being re-used.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the control.

    Source

    container_prepared

    fn container_prepared(self: &Self, handler: impl Fn(&ContainerPreparedEventArgs) -> () + 'static) -> Subscription
    

    Occurs each time a container is prepared for use.

    The prepared element might be newly created or an existing container that is being re-used.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the control.

    Source

    container_index_changed

    fn container_index_changed(self: &Self, handler: impl Fn(&ContainerIndexChangedEventArgs) -> () + 'static) -> Subscription
    

    Occurs for each realized container when the index for the item it represents has changed.

    This event is raised for each realized container where the index for the item it represents has changed. For example, when another item is added or removed in the data source, the index for items that come after in the ordering will be impacted.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the control.

    Source

    container_clearing

    fn container_clearing(self: &Self, handler: impl Fn(&ContainerClearingEventArgs) -> () + 'static) -> Subscription
    

    Occurs each time a container is cleared.

    This event is raised immediately each time an container is cleared, such as when it falls outside the range of realized items or the corresponding item is removed.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the control.

    Source

    DEFAULT_RECYCLE_KEY

    const DEFAULT_RECYCLE_KEY: RecycleKey
    

    Gets a default recycle key that can be used when an ItemsControl supports a single container type.

    Source

    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 has a container; otherwise, None.

    Source

    container_from_item

    fn container_from_item(self: &Self, item: &Option<BoxedValue>) -> Option<Ref<Control>>
    

    Returns the container corresponding to the specified item.

    Returns a container that corresponds to the specified item, if the item has a container and exists in the collection; otherwise, None.

    Source

    index_from_container

    fn index_from_container(self: &Self, container: &Ref<Control>) -> i32
    

    Returns the index to the item that has the specified, generated container.

    Returns the index to the item that corresponds to the specified generated container, or -1 if container is not found.

    Source

    item_from_container

    fn item_from_container(self: &Self, container: &Ref<Control>) -> Option<BoxedValue>
    

    Returns the item that corresponds to the specified, generated container.

    Returns the contained item, or None if the container does not contain an item.

    Source

    get_realized_containers

    fn get_realized_containers(self: &Self) -> Vec<Ref<Control>>
    

    Gets the currently realized containers.

    Source

    scroll_into_view

    fn scroll_into_view(self: &Self, index: i32)
    

    Scrolls the specified item into view.

    Source

    scroll_into_view_item

    fn scroll_into_view_item(self: &Self, item: &Option<BoxedValue>)
    

    Scrolls the specified item into view.

    Source

    items_control_from_item_container

    fn items_control_from_item_container(container: &Ref<Control>) -> Option<Ref<ItemsControl>>
    

    Returns the ItemsControl that owns the specified container control.

    Returns the owning ItemsControl or None if the control is not an items container.

    Source

    needs_container

    fn needs_container<T: ObjectType + Upcast<Control>>(self: &Self, item: &Option<BoxedValue>) -> (bool, Option<RecycleKey>)
    

    A default implementation of needs_container_override that returns true and sets the recycle key to DEFAULT_RECYCLE_KEY if the item is not a T.

    Source

    refresh_containers

    fn refresh_containers(self: &Self)
    

    Refreshes the containers displayed by the control.

    Causes all containers to be unrealized and re-realized.

    Source

    get_next_control

    fn get_next_control(container: &dyn INavigableContainer, direction: NavigationDirection, from: Option<&Ref<InputElement>>, wrap: bool) -> Option<Ref<InputElement>>
    

    Gets the next focusable, enabled and visible control of a container in the specified direction.

    Source

    Trait implementations

    Availability

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