# ICreatesObservableForProperty

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/binding/interfaces/trait-icreatesobservableforproperty/

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

```rust
trait ICreatesObservableForProperty
```

Provides the change notifications of the properties of the objects it supports; of the
implementations registered in `AppLocator`, the one with the highest affinity for an object and
a property is the one used (`ICreatesObservableForProperty`).

The object is a `PropertyOwner`: the object that owns the property, type-erased, with its
`PropertyChanged` notification when it has one. It is what one step of a
`PropertyPath` gives
(`PathStep::owner`).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/interfaces/i_creates_observable_for_property.rs#L19)

## Members

- [`get_affinity_for_object`](#function-get_affinity_for_object)
- [`get_notification_for_property`](#function-get_notification_for_property)

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

### get_affinity_for_object

```rust
fn get_affinity_for_object(self: &Self, owner: &PropertyOwner, property_name: &str, before_changed: bool) -> i32
```

How well this implementation can observe `property_name` of `owner`: a positive score when
it can, where a higher score wins; zero or negative when it cannot
(`GetAffinityForObject`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/interfaces/i_creates_observable_for_property.rs#L23)

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

### get_notification_for_property

```rust
fn get_notification_for_property(self: &Self, owner: &PropertyOwner, property_name: &str, before_changed: bool, suppress_warnings: bool) -> Rc<dyn IObservable<ObservedChange<PropertyOwner, ()>>>
```

A sequence that produces a change each time `property_name` of `owner` changes, or is about
to change when `before_changed` is set (`GetNotificationForProperty`). The changes carry no
value: the caller reads the current value from the object. `suppress_warnings` skips the
warning written for a property that cannot notify.

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

## Trait implementations

- [`ICreatesObservableForProperty`](/docs/0.5.0/api/ferroui-reactiveui/binding/interfaces/trait-icreatesobservableforproperty/)

## Availability

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