1234567891011121314151617181920212223242526272829303132333435 |
- using Avalonia.Input;
- namespace Avalonia.Xaml.Interactions.Events;
- /// <summary>
- ///
- /// </summary>
- public abstract class GotFocusEventBehavior : InteractiveBehaviorBase
- {
- /// <inheritdoc />
- protected override void OnAttachedToVisualTree()
- {
- AssociatedObject?.AddHandler(InputElement.GotFocusEvent, GotFocus, RoutingStrategies);
- }
- /// <inheritdoc />
- protected override void OnDetachedFromVisualTree()
- {
- AssociatedObject?.RemoveHandler(InputElement.GotFocusEvent, GotFocus);
- }
- private void GotFocus(object? sender, GotFocusEventArgs e)
- {
- OnGotFocus(sender, e);
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected virtual void OnGotFocus(object? sender, GotFocusEventArgs e)
- {
- }
- }
|