// ----------------------------------------------------------------------- // // Copyright 2014 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- namespace Perspex.Interactivity { using System; /// /// Interface for objects that raise routed events. /// public interface IInteractive { /// /// Gets the interactive parent of the object for bubbling and tunnelling 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. IDisposable 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. IDisposable 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; /// /// Raises a routed event. /// /// The event args. void RaiseEvent(RoutedEventArgs e); } }