# SelectingItemsControl

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/primitives/struct-selectingitemscontrol/

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

```rust
struct SelectingItemsControl
```

An [`ItemsControl`](/docs/0.5.0/api/ferroui-controls/struct-itemscontrol/) that maintains a selection.

[`SelectingItemsControl`](/docs/0.5.0/api/ferroui-controls/primitives/struct-selectingitemscontrol/) provides a base class for [`ItemsControl`](/docs/0.5.0/api/ferroui-controls/struct-itemscontrol/)s
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`](/docs/0.5.0/api/ferroui-controls/primitives/struct-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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L128)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`should_trigger_selection`](#function-should_trigger_selection)
- [`should_trigger_selection_key`](#function-should_trigger_selection_key)
- [`update_selection_from_event`](#function-update_selection_from_event)
- [`auto_scroll_to_selected_item_property`](#function-auto_scroll_to_selected_item_property)
- [`selected_index_property`](#function-selected_index_property)
- [`selected_item_property`](#function-selected_item_property)
- [`selected_value_property`](#function-selected_value_property)
- [`selected_value_binding_property`](#function-selected_value_binding_property)
- [`selected_items_property`](#function-selected_items_property)
- [`selection_property`](#function-selection_property)
- [`selection_mode_property`](#function-selection_mode_property)
- [`is_selected_property`](#function-is_selected_property)
- [`is_text_search_enabled_property`](#function-is_text_search_enabled_property)
- [`is_selected_changed_event`](#function-is_selected_changed_event)
- [`selection_changed_event`](#function-selection_changed_event)
- [`wrap_selection_property`](#function-wrap_selection_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`selection_changed`](#function-selection_changed)
- [`auto_scroll_to_selected_item`](#function-auto_scroll_to_selected_item)
- [`set_auto_scroll_to_selected_item`](#function-set_auto_scroll_to_selected_item)
- [`selected_index`](#function-selected_index)
- [`set_selected_index`](#function-set_selected_index)
- [`selected_item`](#function-selected_item)
- [`set_selected_item`](#function-set_selected_item)
- [`selected_value_binding`](#function-selected_value_binding)
- [`set_selected_value_binding`](#function-set_selected_value_binding)
- [`selected_value`](#function-selected_value)
- [`set_selected_value`](#function-set_selected_value)
- [`selected_items`](#function-selected_items)
- [`set_selected_items`](#function-set_selected_items)
- [`selection`](#function-selection)
- [`set_selection`](#function-set_selection)
- [`is_text_search_enabled`](#function-is_text_search_enabled)
- [`set_is_text_search_enabled`](#function-set_is_text_search_enabled)
- [`wrap_selection`](#function-wrap_selection)
- [`set_wrap_selection`](#function-set_wrap_selection)
- [`selection_mode`](#function-selection_mode)
- [`set_selection_mode`](#function-set_selection_mode)
- [`always_selected`](#function-always_selected)
- [`get_is_selected`](#function-get_is_selected)
- [`set_is_selected`](#function-set_is_selected)
- [`get_container_from_event_source`](#function-get_container_from_event_source)
- [`selecting_items_control_from_item_container`](#function-selecting_items_control_from_item_container)
- [`move_selection`](#function-move_selection)
- [`move_selection_from`](#function-move_selection_from)
- [`update_selection`](#function-update_selection)
- [`update_selection_for_container`](#function-update_selection_for_container)
- [`update_selection_from_event_source`](#function-update_selection_from_event_source)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L149)

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<SelectingItemsControl>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L149)

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

### should_trigger_selection

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L149)

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

### should_trigger_selection_key

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L149)

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

### update_selection_from_event

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L149)

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

### auto_scroll_to_selected_item_property

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

Defines the `AutoScrollToSelectedItem` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L462)

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

### selected_index_property

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

Defines the `SelectedIndex` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L462)

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

### selected_item_property

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

Defines the `SelectedItem` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L462)

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

### selected_value_property

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

Defines the `SelectedValue` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L462)

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

### selected_value_binding_property

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

Defines the `SelectedValueBinding` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L462)

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

### selected_items_property

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

Defines the `SelectedItems` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L462)

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

### selection_property

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

Defines the `Selection` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L462)

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

### selection_mode_property

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

Defines the `SelectionMode` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L462)

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

### is_selected_property

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

Defines the `IsSelected` attached property on a container
`Control`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L462)

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

### is_text_search_enabled_property

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

Defines the `IsTextSearchEnabled` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L462)

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

### is_selected_changed_event

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L566)

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

### selection_changed_event

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

Defines the `SelectionChanged` event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L575)

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

### wrap_selection_property

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

Defines the `WrapSelection` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L582)

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

### construct

```rust
fn construct() -> Self
```

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L595)

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

### new

```rust
fn new() -> Ref<Self>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L618)

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

### selection_changed

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

Occurs when the control's selection changes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L623)

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

### auto_scroll_to_selected_item

```rust
fn auto_scroll_to_selected_item(self: &Self) -> bool
```

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L632)

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

### set_auto_scroll_to_selected_item

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L636)

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

### selected_index

```rust
fn selected_index(self: &Self) -> i32
```

Gets or sets the index of the selected item.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L641)

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

### set_selected_index

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L659)

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

### selected_item

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

Gets or sets the selected item.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L669)

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

### set_selected_item

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L682)

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

### selected_value_binding

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L693)

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

### set_selected_value_binding

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L697)

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

### selected_value

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

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L703)

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

### set_selected_value

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L707)

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

### selected_items

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L716)

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

### set_selected_items

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L733)

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

### selection

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

Gets or sets the model that holds the current selection.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L747)

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

### set_selection

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L755)

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

### is_text_search_enabled

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L800)

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

### set_is_text_search_enabled

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L804)

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

### wrap_selection

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L810)

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

### set_wrap_selection

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L814)

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

### selection_mode

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L823)

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

### set_selection_mode

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L827)

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

### always_selected

```rust
fn always_selected(self: &Self) -> bool
```

Gets a value indicating whether the `ALWAYS_SELECTED` flag is set.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L832)

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

### get_is_selected

```rust
fn get_is_selected(control: &Control) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L861)

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

### set_is_selected

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

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L866)

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

### get_container_from_event_source

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L874)

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

### selecting_items_control_from_item_container

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

Returns the `SelectingItemsControl` that owns the specified
container control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L893)

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

### move_selection

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L925)

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

### move_selection_from

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L938)

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

### update_selection

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L982)

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

### update_selection_for_container

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L1034)

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

### update_selection_from_event_source

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/selecting_items_control.rs#L1056)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`TemplatedControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimplext/)
- [`SelectingItemsControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-selectingitemscontrolimplext/)
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- [`ItemsControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-itemscontrolimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<SelectingItemsControl>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)
- [`ItemsControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-itemscontrolimpl/)
- [`SelectingItemsControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-selectingitemscontrolimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
