# NotifyCollectionChangedExtensions

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/collections/struct-notifycollectionchangedextensions/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct NotifyCollectionChangedExtensions
```



[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/collections/notify_collection_changed_extensions.rs#L8)

## Members

- [`get_weak_collection_changed_observable`](#function-get_weak_collection_changed_observable)
- [`weak_subscribe`](#function-weak_subscribe)
- [`weak_subscribe_action`](#function-weak_subscribe_action)

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

### get_weak_collection_changed_observable

```rust
fn get_weak_collection_changed_observable(collection: &Rc<dyn INotifyCollectionChanged>) -> Rc<dyn IObservable<CollectionChange>>
```

Gets a weak observable for the CollectionChanged event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/collections/notify_collection_changed_extensions.rs#L12)

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

### weak_subscribe

```rust
fn weak_subscribe(collection: &Rc<dyn INotifyCollectionChanged>, handler: impl Fn(&Rc<dyn INotifyCollectionChanged>, &CollectionChange) -> () + 'static) -> Rc<dyn IDisposable>
```

Subscribes to the CollectionChanged event using a weak subscription.

`handler` is called with the collection and the change when the
collection event is raised. Disposing the returned handle terminates
the subscription.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/collections/notify_collection_changed_extensions.rs#L23)

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

### weak_subscribe_action

```rust
fn weak_subscribe_action(collection: &Rc<dyn INotifyCollectionChanged>, handler: impl Fn(&CollectionChange) -> () + 'static) -> Rc<dyn IDisposable>
```

Subscribes to the CollectionChanged event using a weak subscription.

`handler` is called with the change when the collection event is
raised. Disposing the returned handle terminates the subscription.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/collections/notify_collection_changed_extensions.rs#L36)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`

## Availability

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