Skip to main content

ObservableCollectionEx

Trait ObservableCollectionEx 

Source
pub trait ObservableCollectionEx<T: Clone + PartialEq + 'static> {
    // Required method
    fn notifying_collection(&self) -> ObservableCollection<T>;

    // Provided methods
    fn observe_collection_changes(
        &self,
    ) -> Rc<dyn IObservable<CollectionChangedEventPattern<T>>> { ... }
    fn to_observable_change_set(&self) -> Rc<dyn IObservable<ChangeSet<T>>> { ... }
    fn to_observable_change_set_with_key<K: Eq + Hash + Clone + 'static>(
        &self,
        key_selector: impl Fn(&T) -> K + 'static,
    ) -> Rc<dyn IObservable<ChangeSet<T, K>>> { ... }
}
Expand description

The changes of an observable collection as an observable (ObservableCollectionEx), for ObservableCollection<T>, ObservableCollectionExtended<T> and ReadOnlyObservableCollection<T>.

Deviation (DEVIATIONS.md, DynamicData): upstream’s generic form takes any INotifyCollectionChanged that enumerates its items; here the collections are those that notify their items, which the untyped INotifyCollectionChanged of ferroui-system does not.

Required Methods§

Source

fn notifying_collection(&self) -> ObservableCollection<T>

The observable collection whose changes are observed.

Provided Methods§

Source

fn observe_collection_changes( &self, ) -> Rc<dyn IObservable<CollectionChangedEventPattern<T>>>

The notifications of the changes of the collection (ObserveCollectionChanges).

Source

fn to_observable_change_set(&self) -> Rc<dyn IObservable<ChangeSet<T>>>

The items of the collection as change sets of a list: its items first, then each of its changes (ToObservableChangeSet<T>(), ToObservableChangeSet<TCollection, T>()).

Source

fn to_observable_change_set_with_key<K: Eq + Hash + Clone + 'static>( &self, key_selector: impl Fn(&T) -> K + 'static, ) -> Rc<dyn IObservable<ChangeSet<T, K>>>

to_observable_change_set with each item keyed by key_selector (ToObservableChangeSet<TObject, TKey>(Func<TObject, TKey>)).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: Clone + PartialEq + 'static> ObservableCollectionEx<T> for ObservableCollection<T>

Implementors§