FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    count

    fn count(self: &Self) -> usize
    

    The number of items (Count).

    Source

    get

    fn get(self: &Self, index: usize) -> T
    

    The item at index (the indexer's getter).

    Source

    set

    fn set(self: &Self, index: usize, item: T)
    

    Replaces the item at index (the indexer's setter).

    Source

    insert

    fn insert(self: &Self, index: usize, item: T)
    

    Inserts an item (Insert).

    Source

    remove_at

    fn remove_at(self: &Self, index: usize)
    

    Removes the item at index (RemoveAt).

    Source

    clear

    fn clear(self: &Self)
    

    Removes every item (Clear).

    Source

    to_vec

    fn to_vec(self: &Self) -> Vec<T>
    

    A copy of the items.

    Source

    add

    fn add(self: &Self, item: T)
    

    Adds an item at the end (Add).

    Source

    index_of

    fn index_of(self: &Self, item: &T) -> Option<usize>
    

    The index of item (IndexOf).

    Source

    contains

    fn contains(self: &Self, item: &T) -> bool
    

    Whether the collection has item (Contains).

    Source

    remove

    fn remove(self: &Self, item: &T) -> bool
    

    Removes item; false when it is not there (Remove).

    Source

    load

    fn load(self: &Self, items: Vec<T>)
    

    Clears the collection and adds the items (Load).

    Source

    move_item

    fn move_item(self: &Self, old_index: usize, new_index: usize)
    

    Moves the item at old_index to new_index (Move).

    Source

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

    Source

    Trait implementations

    Availability

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