# BoundsObserverBehavior

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-xaml-interactions-custom/struct-boundsobserverbehavior/

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

```rust
struct BoundsObserverBehavior
```

Observes the bounds given to `bounds` (usually bound to the bounds of a
control) and exposes their width and height.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/control/bounds_observer_behavior.rs#L16)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`bounds_property`](#function-bounds_property)
- [`width_property`](#function-width_property)
- [`height_property`](#function-height_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`bounds`](#function-bounds)
- [`set_bounds`](#function-set_bounds)
- [`width`](#function-width)
- [`set_width`](#function-set_width)
- [`height`](#function-height)
- [`set_height`](#function-set_height)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/control/bounds_observer_behavior.rs#L20)

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<BoundsObserverBehavior>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/control/bounds_observer_behavior.rs#L20)

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

### bounds_property

```rust
fn bounds_property() -> &'static StyledProperty<Rect>
```

Identifies the `Bounds` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/control/bounds_observer_behavior.rs#L24)

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

### width_property

```rust
fn width_property() -> &'static StyledProperty<f64>
```

Identifies the `Width` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/control/bounds_observer_behavior.rs#L24)

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

### height_property

```rust
fn height_property() -> &'static StyledProperty<f64>
```

Identifies the `Height` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/control/bounds_observer_behavior.rs#L24)

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

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/control/bounds_observer_behavior.rs#L75)

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

### new

```rust
fn new() -> Ref<Self>
```

Creates a behavior.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/control/bounds_observer_behavior.rs#L80)

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

### bounds

```rust
fn bounds(self: &Self) -> Rect
```

Gets or sets the observed bounds. This is a property of the object model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/control/bounds_observer_behavior.rs#L85)

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

### set_bounds

```rust
fn set_bounds(self: &Self, value: Rect)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/control/bounds_observer_behavior.rs#L89)

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

### width

```rust
fn width(self: &Self) -> f64
```

Gets or sets the width of the observed bounds. This is a property of the object model,
bound in both directions by default.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/control/bounds_observer_behavior.rs#L95)

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

### set_width

```rust
fn set_width(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/control/bounds_observer_behavior.rs#L99)

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

### height

```rust
fn height(self: &Self) -> f64
```

Gets or sets the height of the observed bounds. This is a property of the object model,
bound in both directions by default.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/control/bounds_observer_behavior.rs#L105)

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

### set_height

```rust
fn set_height(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/control/bounds_observer_behavior.rs#L109)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`DisposingBehaviorImplExt`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-disposingbehaviorimplext/)
- [`StyledElementBehaviorImplExt`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-styledelementbehaviorimplext/)
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<BoundsObserverBehavior>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`StyledElementBehaviorImpl`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-styledelementbehaviorimpl/)
- [`DisposingBehaviorImpl`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-disposingbehaviorimpl/)

## Availability

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