123456789101112131415161718192021222324252627282930313233343536 |
- using Avalonia.Input;
- using Avalonia.Interactivity;
- namespace Avalonia.Xaml.Interactions.Events;
- /// <summary>
- ///
- /// </summary>
- public abstract class LostFocusEventBehavior : InteractiveBehaviorBase
- {
- /// <inheritdoc />
- protected override void OnAttachedToVisualTree()
- {
- AssociatedObject?.AddHandler(InputElement.LostFocusEvent, LostFocus, RoutingStrategies);
- }
- /// <inheritdoc />
- protected override void OnDetachedFromVisualTree()
- {
- AssociatedObject?.RemoveHandler(InputElement.LostFocusEvent, LostFocus);
- }
- private void LostFocus(object? sender, RoutedEventArgs e)
- {
- OnLostFocus(sender, e);
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected virtual void OnLostFocus(object? sender, RoutedEventArgs e)
- {
- }
- }
|