Skip to main content

FocusChangingEventArgs Class

Definition​

Namespace:Avalonia.Input
Assembly:Avalonia.Base
Package:Avalonia
public class FocusChangingEventArgs

Inheritance: EventArgs -> RoutedEventArgs -> FocusChangingEventArgs

Constructors​

NameDescription
FocusChangingEventArgsProvides data for focus changing.

FocusChangingEventArgs Constructor​

Provides data for focus changing.

public FocusChangingEventArgs(Avalonia.Interactivity.RoutedEvent routedEvent)

Parameters​

routedEvent Avalonia.Interactivity.RoutedEvent

Methods​

NameDescription
TryCancelAttempts to cancel the current focus change
TrySetNewFocusedElementAttempts to redirect focus from the targeted element to the specified element.

TryCancel Method​

Attempts to cancel the current focus change

public bool TryCancel()

Returns​

bool

true if focus change was cancelled; otherwise, false

TrySetNewFocusedElement Method​

Attempts to redirect focus from the targeted element to the specified element.

public bool TrySetNewFocusedElement(Avalonia.Input.IInputElement inputElement)

Parameters​

inputElement Avalonia.Input.IInputElement

Returns​

bool

Properties​

NameDescription
CanceledGets whether focus change is canceled.
HandledGets or sets a value indicating whether the routed event has already been handled. Inherited from RoutedEventArgs.
KeyModifiersGets or sets any key modifiers active at the time of focus.
NavigationMethodGets or sets a value indicating how the change in focus occurred.
NewFocusedElementGets or sets the element that focus has moved to.
OldFocusedElementGets or sets the element that previously had focus.
RouteGets or sets the routing strategy (direct, bubbling, or tunneling) of the routed event. Inherited from RoutedEventArgs.
RoutedEventGets or sets the routed event associated with these event args. Inherited from RoutedEventArgs.
SourceGets or sets the source object that raised the routed event. Inherited from RoutedEventArgs.

Canceled Property​

Gets whether focus change is canceled.

public bool Canceled { get; set; }

KeyModifiers Property​

Gets or sets any key modifiers active at the time of focus.

public Avalonia.Input.KeyModifiers KeyModifiers { get; set; }

Gets or sets a value indicating how the change in focus occurred.

public Avalonia.Input.NavigationMethod NavigationMethod { get; set; }

NewFocusedElement Property​

Gets or sets the element that focus has moved to.

public Avalonia.Input.IInputElement NewFocusedElement { get; set; }

OldFocusedElement Property​

Gets or sets the element that previously had focus.

public Avalonia.Input.IInputElement OldFocusedElement { get; set; }