12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using Avalonia.Input;
- using Avalonia.Interactivity;
- namespace Avalonia.Xaml.Interactions.Events;
- /// <summary>
- ///
- /// </summary>
- public abstract class PointerCaptureLostEventBehavior : InteractiveBehaviorBase
- {
- static PointerCaptureLostEventBehavior()
- {
- RoutingStrategiesProperty.OverrideMetadata<PointerCaptureLostEventBehavior>(
- new StyledPropertyMetadata<RoutingStrategies>(
- defaultValue: RoutingStrategies.Direct));
- }
-
- /// <inheritdoc />
- protected override void OnAttachedToVisualTree()
- {
- AssociatedObject?.AddHandler(InputElement.PointerCaptureLostEvent, PointerCaptureLost, RoutingStrategies);
- }
- /// <inheritdoc />
- protected override void OnDetachedFromVisualTree()
- {
- AssociatedObject?.RemoveHandler(InputElement.PointerCaptureLostEvent, PointerCaptureLost);
- }
- private void PointerCaptureLost(object? sender, PointerCaptureLostEventArgs e)
- {
- OnPointerCaptureLost(sender, e);
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected virtual void OnPointerCaptureLost(object? sender, PointerCaptureLostEventArgs e)
- {
- }
- }
|