FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SelectingItemsControl

    struct · ferroui-controls · v0.5.0

    struct SelectingItemsControl
    

    An ItemsControl that maintains a selection.

    SelectingItemsControl provides a base class for ItemsControls that maintain a selection (single or multiple). By default only its selected_index and selected_item properties are visible; the current multiple selection and selected_items together with the selection_mode properties are protected, however a derived class can expose these if it wishes to support multiple selection.

    SelectingItemsControl maintains a selection respecting the current selection_mode but it does not react to user input; this must be handled in a derived class. It does, however, respond to is_selected_changed_event events from items and updates the selection accordingly.

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

    Returns a strong reference to this object.

    Source

    should_trigger_selection

    fn should_trigger_selection(self: &Self, selectable: &Visual, event_args: &PointerEventArgs) -> bool
    

    Analyses a pointer event received by a selectable element, and determines whether the action should trigger selection.

    Source

    should_trigger_selection_key

    fn should_trigger_selection_key(self: &Self, selectable: &Visual, event_args: &KeyEventArgs) -> bool
    

    Analyses a key event received by a selectable element, and determines whether the action should trigger selection.

    Source

    update_selection_from_event

    fn update_selection_from_event(self: &Self, container: &Ref<Control>, event_args: &dyn IRoutedEventArgs) -> bool
    

    Updates the selection based on an event that may have originated in a container that belongs to the control.

    Returns true if the event originated from a container that belongs to the control and triggered selection; otherwise false.

    Source

    auto_scroll_to_selected_item_property

    fn auto_scroll_to_selected_item_property() -> &'static StyledProperty<bool>
    

    Defines the AutoScrollToSelectedItem property.

    Source

    selected_index_property

    fn selected_index_property() -> &'static DirectProperty<SelectingItemsControl, i32>
    

    Defines the SelectedIndex property.

    Source

    selected_item_property

    fn selected_item_property() -> &'static DirectProperty<SelectingItemsControl, Option<BoxedValue>>
    

    Defines the SelectedItem property.

    Source

    selected_value_property

    fn selected_value_property() -> &'static StyledProperty<Option<BoxedValue>>
    

    Defines the SelectedValue property.

    Source

    selected_value_binding_property

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

    Defines the SelectedValueBinding property.

    Source

    selected_items_property

    fn selected_items_property() -> &'static DirectProperty<SelectingItemsControl, Option<SelectedItemsList>>
    

    Defines the SelectedItems property.

    Source

    selection_property

    fn selection_property() -> &'static DirectProperty<SelectingItemsControl, Option<Rc<dyn ISelectionModel>>>
    

    Defines the Selection property.

    Source

    selection_mode_property

    fn selection_mode_property() -> &'static StyledProperty<SelectionMode>
    

    Defines the SelectionMode property.

    Source

    is_selected_property

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

    Defines the IsSelected attached property on a container Control.

    Source

    is_text_search_enabled_property

    fn is_text_search_enabled_property() -> &'static StyledProperty<bool>
    

    Defines the IsTextSearchEnabled property.

    Source

    is_selected_changed_event

    fn is_selected_changed_event() -> &'static RoutedEvent<RoutedEventArgs>
    

    Event that should be raised by containers when their selection state changes to notify the parent SelectingItemsControl that their selection state has changed.

    Source

    selection_changed_event

    fn selection_changed_event() -> &'static RoutedEvent<SelectionChangedEventArgs>
    

    Defines the SelectionChanged event.

    Source

    wrap_selection_property

    fn wrap_selection_property() -> &'static StyledProperty<bool>
    

    Defines the WrapSelection property.

    Source

    construct

    fn construct() -> Self
    

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

    Source

    new

    fn new() -> Ref<Self>
    

    Source

    selection_changed

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

    Occurs when the control's selection changes.

    Source

    auto_scroll_to_selected_item

    fn auto_scroll_to_selected_item(self: &Self) -> bool
    

    Gets or sets a value indicating whether to automatically scroll to newly selected items.

    Source

    set_auto_scroll_to_selected_item

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

    Source

    selected_index

    fn selected_index(self: &Self) -> i32
    

    Gets or sets the index of the selected item.

    Source

    set_selected_index

    fn set_selected_index(self: &Self, value: i32)
    

    Source

    selected_item

    fn selected_item(self: &Self) -> Option<BoxedValue>
    

    Gets or sets the selected item.

    Source

    set_selected_item

    fn set_selected_item(self: &Self, value: Option<BoxedValue>)
    

    Source

    selected_value_binding

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

    Gets the binding instance which will be used to get the value for the selected_value property of the selected item.

    Source

    set_selected_value_binding

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

    Source

    selected_value

    fn selected_value(self: &Self) -> Option<BoxedValue>
    

    Gets or sets the value of the selected item, obtained using selected_value_binding.

    Source

    set_selected_value

    fn set_selected_value(self: &Self, value: Option<BoxedValue>)
    

    Source

    selected_items

    fn selected_items(self: &Self) -> Option<SelectedItemsList>
    

    Gets or sets the selected items.

    By default returns a new list that can be manipulated to change the selection. This property can be set to an existing list to keep the selection of the control in sync with it.

    Source

    set_selected_items

    fn set_selected_items(self: &Self, value: Option<SelectedItemsList>)
    

    Source

    selection

    fn selection(self: &Self) -> Rc<dyn ISelectionModel>
    

    Gets or sets the model that holds the current selection.

    Source

    set_selection

    fn set_selection(self: &Self, value: Option<Rc<dyn ISelectionModel>>)
    

    Source

    is_text_search_enabled

    fn is_text_search_enabled(self: &Self) -> bool
    

    Gets or sets a value that specifies whether a user can jump to a value by typing.

    Source

    set_is_text_search_enabled

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

    Source

    wrap_selection

    fn wrap_selection(self: &Self) -> bool
    

    Gets or sets a value which indicates whether to wrap around when the first or last item is reached.

    Source

    set_wrap_selection

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

    Source

    selection_mode

    fn selection_mode(self: &Self) -> SelectionMode
    

    Gets or sets the selection mode.

    Note that the selection mode only applies to selections made via user interaction. Multiple selections can be made programmatically regardless of the value of this property.

    Source

    set_selection_mode

    fn set_selection_mode(self: &Self, value: SelectionMode)
    

    Source

    always_selected

    fn always_selected(self: &Self) -> bool
    

    Gets a value indicating whether the ALWAYS_SELECTED flag is set.

    Source

    get_is_selected

    fn get_is_selected(control: &Control) -> bool
    

    Source

    set_is_selected

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

    Sets the value of the IsSelected attached property on a control.

    Source

    get_container_from_event_source

    fn get_container_from_event_source(self: &Self, event_source: Option<&Ref<Visual>>) -> Option<Ref<Control>>
    

    Tries to get the container that was the source of an event.

    Returns the container or None if the event did not originate in a container.

    Source

    selecting_items_control_from_item_container

    fn selecting_items_control_from_item_container(container: &Ref<Control>) -> Option<Ref<SelectingItemsControl>>
    

    Returns the SelectingItemsControl that owns the specified container control.

    Source

    move_selection

    fn move_selection(self: &Self, direction: NavigationDirection, wrap: bool, range_modifier: bool) -> bool
    

    Moves the selection in the specified direction relative to the current selection.

    Returns true if the selection was moved; otherwise false.

    Source

    move_selection_from

    fn move_selection_from(self: &Self, from: Option<&Ref<Control>>, direction: NavigationDirection, wrap: bool, range_modifier: bool) -> bool
    

    Moves the selection in the specified direction relative to the specified container.

    Returns true if the selection was moved; otherwise false.

    Source

    update_selection

    fn update_selection(self: &Self, index: i32, select: bool, range_modifier: bool, toggle_modifier: bool, right_button: bool, from_focus: bool)
    

    Updates the selection for an item based on user interaction.

    index is the index of the item, select whether the item should be selected or unselected, range_modifier whether the range modifier is enabled (i.e. shift key), toggle_modifier whether the toggle modifier is enabled (i.e. ctrl key), right_button whether the event is a right-click and from_focus whether the event is a focus event.

    Source

    update_selection_for_container

    fn update_selection_for_container(self: &Self, container: &Ref<Control>, select: bool, range_modifier: bool, toggle_modifier: bool, right_button: bool, from_focus: bool)
    

    Updates the selection for a container based on user interaction.

    Deprecated. Call update_selection_from_event instead.

    Source

    update_selection_from_event_source

    fn update_selection_from_event_source(self: &Self, event_source: Option<&Ref<Visual>>, select: bool, range_modifier: bool, toggle_modifier: bool, right_button: bool, from_focus: bool) -> bool
    

    Updates the selection based on an event source that may have originated in a container that belongs to the control.

    Returns true if the event originated from a container that belongs to the control; otherwise false.

    Deprecated. Call update_selection_from_event instead.

    Source

    Trait implementations

    Availability

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