IBehavior.cs 723 B

1234567891011121314151617181920212223
  1. namespace Avalonia.Xaml.Interactivity;
  2. /// <summary>
  3. /// Interface implemented by all custom behaviors.
  4. /// </summary>
  5. public interface IBehavior
  6. {
  7. /// <summary>
  8. /// Gets the <see cref="AvaloniaObject"/> to which the <seealso cref="IBehavior"/> is attached.
  9. /// </summary>
  10. AvaloniaObject? AssociatedObject { get; }
  11. /// <summary>
  12. /// Attaches to the specified object.
  13. /// </summary>
  14. /// <param name="associatedObject">The <see cref="AvaloniaObject"/> to which the <seealso cref="IBehavior"/> will be attached.</param>
  15. void Attach(AvaloniaObject? associatedObject);
  16. /// <summary>
  17. /// Detaches this instance from its associated object.
  18. /// </summary>
  19. void Detach();
  20. }