# StyledPropertyOptions

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

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

```rust
struct StyledPropertyOptions<T>
```

Options for registering a styled or attached property.

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

## Members

- [`new`](#function-new)
- [`inherits`](#function-inherits)
- [`default_binding_mode`](#function-default_binding_mode)
- [`validate`](#function-validate)
- [`coerce`](#function-coerce)
- [`enable_data_validation`](#function-enable_data_validation)
- [`assign_binding`](#function-assign_binding)
- [`notifying`](#function-notifying)

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

### new

```rust
fn new(default_value: T) -> Self
```



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

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

### inherits

```rust
fn inherits(self: Self, inherits: bool) -> Self
```

Whether the property inherits its value from the parent object.

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

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

### default_binding_mode

```rust
fn default_binding_mode(self: Self, mode: BindingMode) -> Self
```

The default binding mode for the property.

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

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

### validate

```rust
fn validate(self: Self, validate: impl Fn(&T) -> bool + 'static) -> Self
```

A value validation callback. Setting a value for which it returns
false is rejected.

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

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

### coerce

```rust
fn coerce(self: Self, coerce: impl Fn(&FerroObject, T) -> T + 'static) -> Self
```

A value coercion callback.

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

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

### enable_data_validation

```rust
fn enable_data_validation(self: Self, enable: bool) -> Self
```

Whether the property is interested in data validation.

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

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

### assign_binding

```rust
fn assign_binding(self: Self, assign_binding: bool) -> Self
```

Whether a binding given for the property in markup is assigned to the
property instead of bound to it; see `FerroProperty::assign_binding`.

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

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

### notifying

```rust
fn notifying(self: Self, notifying: impl Fn(&FerroObject, bool) -> () + 'static) -> Self
```

A callback invoked before and after change notifications are raised.

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

## 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/).
