using System; namespace Avalonia.Interactivity { /// /// Interface for objects that raise routed events. /// public interface IInteractive { /// /// Gets the interactive parent of the object for bubbling and tunneling events. /// IInteractive? InteractiveParent { get; } /// /// Adds a handler for the specified routed event. /// /// The routed event. /// The handler. /// The routing strategies to listen to. /// Whether handled events should also be listened for. /// A disposable that terminates the event subscription. void AddHandler( RoutedEvent routedEvent, Delegate handler, RoutingStrategies routes = RoutingStrategies.Direct | RoutingStrategies.Bubble, bool handledEventsToo = false); /// /// Adds a handler for the specified routed event. /// /// The type of the event's args. /// The routed event. /// The handler. /// The routing strategies to listen to. /// Whether handled events should also be listened for. /// A disposable that terminates the event subscription. void AddHandler( RoutedEvent routedEvent, EventHandler handler, RoutingStrategies routes = RoutingStrategies.Direct | RoutingStrategies.Bubble, bool handledEventsToo = false) where TEventArgs : RoutedEventArgs; /// /// Removes a handler for the specified routed event. /// /// The routed event. /// The handler. void RemoveHandler(RoutedEvent routedEvent, Delegate handler); /// /// Removes a handler for the specified routed event. /// /// The type of the event's args. /// The routed event. /// The handler. void RemoveHandler(RoutedEvent routedEvent, EventHandler handler) where TEventArgs : RoutedEventArgs; /// /// Adds the object's handlers for a routed event to an event route. /// /// The event. /// The event route. void AddToEventRoute(RoutedEvent routedEvent, EventRoute route); /// /// Raises a routed event. /// /// The event args. void RaiseEvent(RoutedEventArgs e); } }