IObservableCollection
trait · ferroui-dynamic-data · v0.5.0
trait IObservableCollection<T: Clone + PartialEq + 'static>: INotifyCollectionChanged + INotifyPropertyChanged + INotifyCollectionChangedSuspender
The collection that the binding operators fill (IObservableCollection<T>): a list that
notifies its changes and can hold its notifications back.
Deviation (DEVIATIONS.md, DynamicData): the collection is a shared handle, as the object of
.NET is a reference, so its methods take &self; the members of IList<T> that the binding
uses are part of the trait.
Members
countgetsetinsertremove_atclearto_vecaddindex_ofcontainsremoveloadmove_itemclone_changes
count
fn count(self: &Self) -> usize
The number of items (Count).
get
fn get(self: &Self, index: usize) -> T
The item at index (the indexer's getter).
set
fn set(self: &Self, index: usize, item: T)
Replaces the item at index (the indexer's setter).
insert
fn insert(self: &Self, index: usize, item: T)
Inserts an item (Insert).
remove_at
fn remove_at(self: &Self, index: usize)
Removes the item at index (RemoveAt).
clear
fn clear(self: &Self)
Removes every item (Clear).
to_vec
fn to_vec(self: &Self) -> Vec<T>
A copy of the items.
add
fn add(self: &Self, item: T)
Adds an item at the end (Add).
index_of
fn index_of(self: &Self, item: &T) -> Option<usize>
The index of item (IndexOf).
contains
fn contains(self: &Self, item: &T) -> bool
Whether the collection has item (Contains).
remove
fn remove(self: &Self, item: &T) -> bool
Removes item; false when it is not there (Remove).
load
fn load(self: &Self, items: Vec<T>)
Clears the collection and adds the items (Load).
move_item
fn move_item(self: &Self, old_index: usize, new_index: usize)
Moves the item at old_index to new_index (Move).
clone_changes
fn clone_changes(self: &Self, changes: &ChangeSet<T>)
Applies the changes of a list (ListEx.Clone(IList<T>, IChangeSet<T>)): the general form,
which moves items with move_item as upstream does for an
ObservableCollection<T>.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.