# NameScope

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

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

```rust
struct NameScope
```

Implements a name scope.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`name_scope_property`](#function-name_scope_property)
- [`new`](#function-new)
- [`get_name_scope`](#function-get_name_scope)
- [`set_name_scope`](#function-set_name_scope)

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

### TYPE

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

The runtime type of this type.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/name_scope.rs#L60)

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

### name_scope_property

```rust
fn name_scope_property() -> &'static AttachedProperty<Option<NameScopeRef>>
```

Defines the NameScope attached property.

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

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/name_scope.rs#L72)

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

### get_name_scope

```rust
fn get_name_scope(styled: &StyledElement) -> Option<NameScopeRef>
```

Gets the value of the attached NameScope property on a styled element.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/name_scope.rs#L77)

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

### set_name_scope

```rust
fn set_name_scope(styled: &StyledElement, value: Option<NameScopeRef>)
```

Sets the value of the attached NameScope property on a styled element.

The scope is told which element holds it, and the scope the element
held before that it no longer does (see `INameScope::attached_to`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/name_scope.rs#L85)

## 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`
- `Default`
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`INameScope`](/docs/0.5.0/api/ferroui-base/controls/trait-inamescope/)
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)

## Availability

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