FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ObservableCollectionExtended

    struct · ferroui-dynamic-data · v0.5.0

    struct ObservableCollectionExtended<T>
    

    An observable collection with ranges, loads and suspended notifications (ObservableCollectionExtended<T>), the collection that the binding operators fill.

    It is a shared handle over an ObservableCollection<T> (the base class upstream), which items controls read and observe: collection is that collection. The changes made through this handle raise the notifications of the base, except those that are suspended (upstream's overrides of OnCollectionChanged and OnPropertyChanged).

    Deviation (DEVIATIONS.md, DynamicData): a subclass of .NET intercepts the notifications of every change; here the changes made through collection directly are not suspended.

    View source

    Members

    new

    fn new() -> Self
    

    An empty collection (ObservableCollectionExtended()).

    Source

    with_capacity

    fn with_capacity(capacity: usize) -> Self
    

    An empty collection that has room for capacity items (ObservableCollectionExtended(new List<T>(capacity))).

    Source

    from_items

    fn from_items(items: Vec<T>) -> Self
    

    A collection of the items (ObservableCollectionExtended(IEnumerable<T>), ObservableCollectionExtended(List<T>)).

    Source

    collection

    fn collection(self: &Self) -> &ObservableCollection<T>
    

    The observable collection of the items (the base class upstream).

    Source

    ptr_eq

    fn ptr_eq(self: &Self, other: &Self) -> bool
    

    Whether self and other are the same collection.

    Source

    add_collection_changed

    fn add_collection_changed(self: &Self, handler: Rc<CollectionChangedHandler<T>>) -> u64
    

    Adds a handler of the typed change notifications; returns the token that removes it (CollectionChanged +=).

    Source

    remove_collection_changed

    fn remove_collection_changed(self: &Self, token: u64) -> bool
    

    Removes a handler (CollectionChanged -=).

    Source

    count

    fn count(self: &Self) -> usize
    

    The number of items (Count).

    Source

    is_empty

    fn is_empty(self: &Self) -> bool
    

    Source

    get

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

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

    Source

    items

    fn items(self: &Self) -> Ref<'_, Vec<T>>
    

    The items, borrowed.

    Source

    to_vec

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

    A copy of the items.

    Source

    contains

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

    Whether the collection has item (Contains).

    Source

    index_of

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

    The index of item (IndexOf).

    Source

    add

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

    Adds an item at the end (Add).

    Source

    insert

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

    Inserts an item (InsertItem).

    Source

    set

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

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

    Source

    remove_at

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

    Removes the item at index (RemoveItem).

    Source

    remove

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

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

    Source

    move_item

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

    Moves the item at old_index to new_index (Move, MoveItem).

    Source

    clear

    fn clear(self: &Self)
    

    Removes every item (ClearItems): a reset.

    Source

    add_range

    fn add_range(self: &Self, items: impl IntoIterator<Item = T>)
    

    Adds the items at the end, one at a time (AddRange).

    Source

    insert_range

    fn insert_range(self: &Self, items: impl IntoIterator<Item = T>, index: usize)
    

    Inserts the items from index, one at a time (InsertRange).

    Source

    load

    fn load(self: &Self, items: impl IntoIterator<Item = T>)
    

    Clears the collection and adds the items (Load).

    Source

    remove_range

    fn remove_range(self: &Self, index: usize, count: usize)
    

    Removes count items from index, one at a time (RemoveRange).

    Source

    suspend_count

    fn suspend_count(self: &Self) -> Rc<dyn IDisposable>
    

    Holds back the notifications of Count until the handle is disposed, which raises Count once if it changed (SuspendCount).

    Source

    suspend_notifications

    fn suspend_notifications(self: &Self) -> Rc<dyn IDisposable>
    

    Holds back the notifications of changes and of Count until the handle is disposed, which raises Count and a reset (SuspendNotifications).

    Source

    on_property_changed

    fn on_property_changed(self: &Self, name: &str)
    

    Raises PropertyChanged, unless it is Count and the count is suspended (OnPropertyChanged).

    Source

    on_collection_changed

    fn on_collection_changed(self: &Self, action: NotifyCollectionChangedAction, new_items: &[T], old_items: &[T], new_starting_index: i32, old_starting_index: i32)
    

    Raises CollectionChanged, unless the notifications are suspended (OnCollectionChanged).

    Source

    Trait implementations

    Availability

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