# ObservableCollectionEx

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-dynamic-data/binding/trait-observablecollectionex/

**trait** · [`ferroui-dynamic-data`](/docs/0.5.0/api/ferroui-dynamic-data/) · v0.5.0

```rust
trait ObservableCollectionEx<T: Clone + PartialEq + 'static>
```

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.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/binding/observable_collection_ex.rs#L27)

## Members

- [`notifying_collection`](#function-notifying_collection)
- [`observe_collection_changes`](#function-observe_collection_changes)
- [`to_observable_change_set`](#function-to_observable_change_set)
- [`to_observable_change_set_with_key`](#function-to_observable_change_set_with_key)

<a id="function-notifying_collection"></a>

### notifying_collection

```rust
fn notifying_collection(self: &Self) -> ObservableCollection<T>
```

The observable collection whose changes are observed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/binding/observable_collection_ex.rs#L29)

<a id="function-observe_collection_changes"></a>

### observe_collection_changes

```rust
fn observe_collection_changes(self: &Self) -> Rc<dyn IObservable<CollectionChangedEventPattern<T>>>
```

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/binding/observable_collection_ex.rs#L32)

<a id="function-to_observable_change_set"></a>

### to_observable_change_set

```rust
fn to_observable_change_set(self: &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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/binding/observable_collection_ex.rs#L38)

<a id="function-to_observable_change_set_with_key"></a>

### to_observable_change_set_with_key

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

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/binding/observable_collection_ex.rs#L44)

## Trait implementations

- [`ObservableCollectionEx<T>`](/docs/0.5.0/api/ferroui-dynamic-data/binding/trait-observablecollectionex/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
