# RelativeSourceMode

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/data/enum-relativesourcemode/

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

```rust
enum RelativeSourceMode
```

Defines the mode of a [`RelativeSource`](/docs/0.5.0/api/ferroui-base/data/struct-relativesource/).

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

## Members

- [`DataContext`](#variant-datacontext)
- [`TemplatedParent`](#variant-templatedparent)
- [`SelfMode`](#variant-selfmode)
- [`FindAncestor`](#variant-findancestor)

<a id="variant-datacontext"></a>

### DataContext

```rust
DataContext
```

The binding will be to the element's data context.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/relative_source.rs#L9)

<a id="variant-templatedparent"></a>

### TemplatedParent

```rust
TemplatedParent
```

The binding will be to the element's templated parent.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/relative_source.rs#L11)

<a id="variant-selfmode"></a>

### SelfMode

```rust
SelfMode
```

The binding will be to the element itself.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/relative_source.rs#L13)

<a id="variant-findancestor"></a>

### FindAncestor

```rust
FindAncestor
```

The binding will be to an ancestor of the element in the visual or
logical tree.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/relative_source.rs#L16)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ResourceKeyObject`](/docs/0.5.0/api/ferroui-base/controls/trait-resourcekeyobject/)
- [`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`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Hash`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- [`ValueTypeRegistration`](/docs/0.5.0/api/ferroui-base/data/core/trait-valuetyperegistration/)

## Availability

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