# VisualTreeAttachmentEventArgs

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

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

```rust
struct VisualTreeAttachmentEventArgs
```

Holds the event arguments for the `attached_to_visual_tree` and
`detached_from_visual_tree` events.

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

## Members

- [`attachment_point`](#function-attachment_point)
- [`parent`](#function-parent)
- [`root`](#function-root)
- [`root_visual`](#function-root_visual)
- [`set_root_visual`](#function-set_root_visual)

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

### attachment_point

```rust
fn attachment_point(self: &Self) -> Option<&Ref<Visual>>
```

The parent that the visual's tree is being attached to or detached
from. `None` when the presentation source's root visual itself is
being attached or detached.

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

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

### parent

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

The parent that the visual's tree is being attached to or detached
from.

> **Deprecated.** Use attachment_point

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

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

### root

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

The root visual of the tree.

> **Deprecated.** This was previously always returning TopLevel. This is no longer guaranteed. Use TopLevel::get_top_level(visual) if you need a TopLevel or root_visual if you are interested in the root of the visual tree.

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

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

### root_visual

```rust
fn root_visual(self: &Self) -> &Ref<Visual>
```

The root visual of the tree this visual is being attached to or
detached from: the root visual of the presentation source.

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

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

### set_root_visual

```rust
fn set_root_visual(self: &mut Self, value: Ref<Visual>)
```



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

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