Edit

Share via


FocusBehavior Class

Definition

This behavior sets the focus on the first control of Targets which accepts it. The focus will be set following the Targets order. The first control being ready and accepting the focus will receive it. The focus can be set to another control with a higher priority if it loads before FocusEngagementTimeout. The focus can be set to another control if some controls will be loaded/unloaded later.

[Windows.UI.Xaml.Markup.ContentProperty(Name="Targets")]
public sealed class FocusBehavior : Microsoft.Toolkit.Uwp.UI.Behaviors.BehaviorBase<Windows.UI.Xaml.UIElement>
[<Windows.UI.Xaml.Markup.ContentProperty(Name="Targets")>]
type FocusBehavior = class
    inherit BehaviorBase<UIElement>
Public NotInheritable Class FocusBehavior
Inherits BehaviorBase(Of UIElement)
Inheritance
Microsoft.Xaml.Interactivity.Behavior<T>
BehaviorBase<Windows.UI.Xaml.UIElement>
FocusBehavior
Attributes
Windows.UI.Xaml.Markup.ContentPropertyAttribute

Constructors

FocusBehavior()

Initializes a new instance of the FocusBehavior class.

Fields

FocusEngagementTimeoutProperty

The DP to store the FocusEngagementTimeout property value.

TargetsProperty

The DP to store the Targets property value.

Properties

FocusEngagementTimeout

Gets or sets the timeout before the FocusBehavior stops trying to set the focus to a control with a higher priority.

IsAttached

Gets a value indicating whether this behavior is attached.

(Inherited from BehaviorBase<T>)
Targets

Gets or sets the ordered list of controls which should receive the focus when the associated object is loaded.

Methods

Initialize()

Initializes the behavior to the associated object.

(Inherited from BehaviorBase<T>)
OnAssociatedObjectLoaded()

Called when the associated object has been loaded.

(Inherited from BehaviorBase<T>)
OnAssociatedObjectUnloaded()

Called when the associated object has been unloaded.

(Inherited from BehaviorBase<T>)
OnAttached()

Called after the behavior is attached to the Microsoft.Xaml.Interactivity.Behavior.AssociatedObject.

(Inherited from BehaviorBase<T>)
OnDetaching()

Called when the behavior is being detached from its Microsoft.Xaml.Interactivity.Behavior.AssociatedObject.

(Inherited from BehaviorBase<T>)
Uninitialize()

Uninitializes the behavior from the associated object.

(Inherited from BehaviorBase<T>)

Applies to