# LogicalTreeAttachmentEventArgs

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

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

```rust
struct LogicalTreeAttachmentEventArgs
```

Holds the event arguments for the `attached_to_logical_tree` and
`detached_from_logical_tree` events.
The args are immutable: copies compare equal when they describe the same
attachment (the same elements).

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

## Members

- [`new`](#function-new)
- [`root`](#function-root)
- [`source`](#function-source)
- [`parent`](#function-parent)

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

### new

```rust
fn new(root: Ref<StyledElement>, source: Ref<StyledElement>, parent: Option<Ref<StyledElement>>) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/logical_tree/logical_tree_attachment_event_args.rs#L25)

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

### root

```rust
fn root(self: &Self) -> &Ref<StyledElement>
```

The root of the logical tree that the control is being attached to or
detached from.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/logical_tree/logical_tree_attachment_event_args.rs#L47)

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

### source

```rust
fn source(self: &Self) -> &Ref<StyledElement>
```

The control that was attached or detached from the logical tree.

Logical tree attachment events travel down the tree, so this is the
control at the top of the subtree that was attached or detached.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/logical_tree/logical_tree_attachment_event_args.rs#L55)

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

### parent

```rust
fn parent(self: &Self) -> Option<&Ref<StyledElement>>
```

The control that the source is being attached to or detached from.
For a detachment this is the old parent; `None` when the source is a
logical root.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/logical_tree/logical_tree_attachment_event_args.rs#L62)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`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`
- `PartialEq`

## Availability

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