# ObjectPropertyChangedObservable

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

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

```rust
struct ObjectPropertyChangedObservable
```

The change notifications of one property on one object.

Returned by
`get_property_changed_observable`.
Change notifications borrow their values, so handlers are closures rather
than observers. The object is held weakly.

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

## Members

- [`subscribe`](#function-subscribe)
- [`add_class_handler`](#function-add_class_handler)

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

### subscribe

```rust
fn subscribe(self: &Self, handler: impl Fn(&FerroPropertyChangedEventArgs<'_>) -> () + 'static) -> Subscription
```

Subscribes to changes of the property on the object.

Dropping the returned guard removes the handler; call
`detach` to keep it for the life of the
object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_object_extensions.rs#L453)

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

### add_class_handler

```rust
fn add_class_handler<TTarget: ObjectType>(self: &Self, handler: impl Fn(&TTarget, &FerroPropertyChangedEventArgs<'_>) -> () + 'static) -> Subscription
```

Subscribes a handler that is only invoked when the object is of class
`TTarget` (or a class derived from it).

Dropping the returned guard removes the handler; call
`detach` to keep it for the life of the
object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/ferro_object_extensions.rs#L471)

## Trait implementations

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

## Availability

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