# FocusBehaviorBase

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

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

```rust
struct FocusBehaviorBase
```

The base class of the behaviors that focus their associated control: the navigation method
and the key modifiers the focus is given with.

The class is abstract: a deriving class implements
`AttachedToVisualTreeBehaviorImpl::on_attached_to_visual_tree_override` and calls
`focus`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/focus/focus_behavior_base.rs#L19)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`focus`](#function-focus)
- [`navigation_method_property`](#function-navigation_method_property)
- [`key_modifiers_property`](#function-key_modifiers_property)
- [`construct`](#function-construct)
- [`navigation_method`](#function-navigation_method)
- [`set_navigation_method`](#function-set_navigation_method)
- [`key_modifiers`](#function-key_modifiers)
- [`set_key_modifiers`](#function-set_key_modifiers)

<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/focus/focus_behavior_base.rs#L23)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/focus/focus_behavior_base.rs#L23)

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

### focus

```rust
fn focus(self: &Self) -> bool
```

Focuses the associated control, in a job of the dispatcher.

Returns true when the focus is requested; false when the behavior is disabled.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/focus/focus_behavior_base.rs#L23)

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

### navigation_method_property

```rust
fn navigation_method_property() -> &'static StyledProperty<NavigationMethod>
```

Identifies the `NavigationMethod` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/focus/focus_behavior_base.rs#L41)

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

### key_modifiers_property

```rust
fn key_modifiers_property() -> &'static StyledProperty<KeyModifiers>
```

Identifies the `KeyModifiers` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/focus/focus_behavior_base.rs#L41)

<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/focus/focus_behavior_base.rs#L80)

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

### navigation_method

```rust
fn navigation_method(self: &Self) -> NavigationMethod
```

Gets or sets the navigation method the focus is given with. This is a property of the
object model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/focus/focus_behavior_base.rs#L86)

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

### set_navigation_method

```rust
fn set_navigation_method(self: &Self, value: NavigationMethod)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/focus/focus_behavior_base.rs#L90)

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

### key_modifiers

```rust
fn key_modifiers(self: &Self) -> KeyModifiers
```

Gets or sets the key modifiers the focus is given with. This is a property of the object
model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/focus/focus_behavior_base.rs#L96)

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

### set_key_modifiers

```rust
fn set_key_modifiers(self: &Self, value: KeyModifiers)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/focus/focus_behavior_base.rs#L100)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`AttachedToVisualTreeBehaviorImplExt`](/docs/0.5.0/api/ferroui-xaml-interactions-custom/trait-attachedtovisualtreebehaviorimplext/)
- [`FocusBehaviorBaseImplExt`](/docs/0.5.0/api/ferroui-xaml-interactions-custom/trait-focusbehaviorbaseimplext/)
- `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<FocusBehaviorBase>`](/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/)
- [`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/)
- [`AttachedToVisualTreeBehaviorImpl`](/docs/0.5.0/api/ferroui-xaml-interactions-custom/trait-attachedtovisualtreebehaviorimpl/)
- [`FocusBehaviorBaseImpl`](/docs/0.5.0/api/ferroui-xaml-interactions-custom/trait-focusbehaviorbaseimpl/)

## Availability

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