SelectionModel
struct · ferroui-controls-repeater · v0.5.0
struct SelectionModel
The WinUI hierarchical selection model, independent of realized controls.
It defaults to multiple selection, can resolve arbitrary nested sources, represents group
selection as Some(true), Some(false) or None (partial), and keeps selection synchronized
with source collection changes. Its tree is realized only as requested by selection operations.
Members
newsourceset_sourcesingle_selectset_single_selectanchor_indexset_anchor_indexset_anchor_index_flatset_anchor_index_with_groupselected_indexset_selected_indexselected_itemselected_indicesselected_itemsselectdeselectselect_with_groupdeselect_with_groupselect_atdeselect_atis_selectedis_selected_with_groupis_selected_atselect_range_from_anchordeselect_range_from_anchorselect_range_from_anchor_with_groupdeselect_range_from_anchor_with_groupselect_range_from_anchor_todeselect_range_from_anchor_toselect_rangedeselect_rangeselect_allselect_all_flatclear_selectionselection_changedchildren_requestedon_property_changedis_selection_invalidated_due_to_collection_changesource_from_item
new
fn new() -> Rc<Self>
source
fn source(self: &Self) -> Option<ItemsSource>
set_source
fn set_source(self: &Self, source: Option<ItemsSource>)
single_select
fn single_select(self: &Self) -> bool
set_single_select
fn set_single_select(self: &Self, value: bool)
anchor_index
fn anchor_index(self: &Self) -> Option<IndexPath>
set_anchor_index
fn set_anchor_index(self: &Self, value: Option<IndexPath>) -> Result<(), SelectionError>
set_anchor_index_flat
fn set_anchor_index_flat(self: &Self, index: i32) -> Result<(), SelectionError>
set_anchor_index_with_group
fn set_anchor_index_with_group(self: &Self, group: i32, item: i32) -> Result<(), SelectionError>
selected_index
fn selected_index(self: &Self) -> Option<IndexPath>
set_selected_index
fn set_selected_index(self: &Self, index: Option<IndexPath>) -> Result<(), SelectionError>
selected_item
fn selected_item(self: &Self) -> Option<BoxedValue>
selected_indices
fn selected_indices(self: &Self) -> SelectedItems<IndexPath>
selected_items
fn selected_items(self: &Self) -> SelectedItems<Option<BoxedValue>>
select
fn select(self: &Self, index: i32) -> Result<(), SelectionError>
deselect
fn deselect(self: &Self, index: i32) -> Result<(), SelectionError>
select_with_group
fn select_with_group(self: &Self, group: i32, item: i32) -> Result<(), SelectionError>
deselect_with_group
fn deselect_with_group(self: &Self, group: i32, item: i32) -> Result<(), SelectionError>
select_at
fn select_at(self: &Self, path: &IndexPath) -> Result<(), SelectionError>
deselect_at
fn deselect_at(self: &Self, path: &IndexPath) -> Result<(), SelectionError>
is_selected
fn is_selected(self: &Self, index: i32) -> Option<bool>
is_selected_with_group
fn is_selected_with_group(self: &Self, group: i32, item: i32) -> Option<bool>
is_selected_at
fn is_selected_at(self: &Self, path: &IndexPath) -> Result<Option<bool>, SelectionError>
select_range_from_anchor
fn select_range_from_anchor(self: &Self, index: i32) -> Result<(), SelectionError>
deselect_range_from_anchor
fn deselect_range_from_anchor(self: &Self, index: i32) -> Result<(), SelectionError>
select_range_from_anchor_with_group
fn select_range_from_anchor_with_group(self: &Self, group: i32, item: i32) -> Result<(), SelectionError>
deselect_range_from_anchor_with_group
fn deselect_range_from_anchor_with_group(self: &Self, group: i32, item: i32) -> Result<(), SelectionError>
select_range_from_anchor_to
fn select_range_from_anchor_to(self: &Self, index: &IndexPath) -> Result<(), SelectionError>
deselect_range_from_anchor_to
fn deselect_range_from_anchor_to(self: &Self, index: &IndexPath) -> Result<(), SelectionError>
select_range
fn select_range(self: &Self, start: &IndexPath, end: &IndexPath) -> Result<(), SelectionError>
deselect_range
fn deselect_range(self: &Self, start: &IndexPath, end: &IndexPath) -> Result<(), SelectionError>
select_all
fn select_all(self: &Self) -> Result<(), SelectionError>
select_all_flat
fn select_all_flat(self: &Self)
Selects a flat source as a single range without reading source items.
clear_selection
fn clear_selection(self: &Self)
selection_changed
fn selection_changed(self: &Self, handler: impl Fn(&SelectionModelSelectionChangedEventArgs) -> () + 'static) -> Rc<dyn IDisposable>
children_requested
fn children_requested(self: &Self, handler: impl Fn(&Rc<SelectionModelChildrenRequestedEventArgs>) -> () + 'static) -> Rc<dyn IDisposable>
on_property_changed
fn on_property_changed(self: &Self, property_name: &str)
is_selection_invalidated_due_to_collection_change
fn is_selection_invalidated_due_to_collection_change(self: &Self) -> bool
source_from_item
fn source_from_item(data: &BoxedValue) -> Option<ItemsSource>
Applies FerroUI's registered collection conversions when automatically resolving children.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyToStringAnyValueClassDefaultsErasedDestructorIntoEitherMarkupTypedINotifyPropertyChangedPartialEqDisplay
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.