# IReactiveObject

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/reactive_object/trait-ireactiveobject/

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

```rust
trait IReactiveObject: INotifyPropertyChanged + INotifyPropertyChanging + IEnableLogger + 'static
```

A view model that notifies when its properties are changing and have changed
(`IReactiveObject`); `reactive_object!` implements it for a type that
holds a [`ReactiveObject`](/docs/0.5.0/api/ferroui-reactiveui/reactive_object/struct-reactiveobject/).

The raising methods go through the state of the object: they follow its suppression and delay,
and feed both the events and the observables of the changes. Helpers outside the object, such
as the helper of a derived property, raise the changes of the object through them.

Deviation (DEVIATIONS.md, ReactiveUI): upstream's `IReactiveObjectStateSlot`, the optional slot
that holds the state on the object, is `reactive_object`: every
reactive object holds its state, since there is no table of states keyed by object
(`ConditionalWeakTable`).

Deviation (DEVIATIONS.md, ReactiveUI): upstream's `RaisePropertyChanging(PropertyChangingEventArgs)`
and `RaisePropertyChanged(PropertyChangedEventArgs)` invoke the events, and the extension
methods of the same names go through the state. The two cannot share a name in Rust (a call
would be ambiguous), so these methods are the extension methods, and the state raises the
events of the [`ReactiveObject`](/docs/0.5.0/api/ferroui-reactiveui/reactive_object/struct-reactiveobject/) itself.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/reactive_object/i_reactive_object.rs#L26)

## Members

- [`reactive_object`](#function-reactive_object)
- [`raise_property_changing`](#function-raise_property_changing)
- [`raise_property_changed`](#function-raise_property_changed)

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

### reactive_object

```rust
fn reactive_object(self: &Self) -> &ReactiveObject
```

The part that holds the events and the state of the change notifications
(`IReactiveObjectStateSlot.GetReactiveStateSlot`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/reactive_object/i_reactive_object.rs#L29)

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

### raise_property_changing

```rust
fn raise_property_changing(self: &Self, property_name: &str)
```

Raises the notifications of a property that is about to change: the `PropertyChanging`
event and the `Changing` observable (`RaisePropertyChanging(string)`). For properties
whose setter does more than `raise_and_set_if_changed`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/reactive_object/i_reactive_object.rs#L34)

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

### raise_property_changed

```rust
fn raise_property_changed(self: &Self, property_name: &str)
```

Raises the notifications of a property that changed: the `PropertyChanged` event and the
`Changed` observable (`RaisePropertyChanged(string)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/reactive_object/i_reactive_object.rs#L40)

## Trait implementations

- [`IReactiveObject`](/docs/0.5.0/api/ferroui-reactiveui/reactive_object/trait-ireactiveobject/)

## Availability

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