RaisedRoutedEvent
Represents a raised routed event instance that captures the complete context of a routed event occurrence, including sender information, routing direction, and event identity for use in event behavior processing.
The RaisedRoutedEvent class encapsulates all the information necessary to identify and match specific routed event occurrences within the event behavior system. It serves as a snapshot of a routed event's context at the time it was raised, enabling sophisticated event filtering and behavior triggering based on multiple criteria.
This class is used primarily by the event behavior system to determine whether specific behaviors should be executed in response to routed events. It provides flexible matching capabilities based on event identity, sender characteristics, and routing direction, allowing for precise control over when event behaviors are triggered.
The class supports XML serialization for persistence scenarios and includes specialized methods for event matching that enable complex event behavior conditions to be evaluated efficiently.
Definition
Namespace:Telerik.WinControls
Assembly:Telerik.WinControls.dll
Syntax:
public class RaisedRoutedEvent
Inheritance: objectRaisedRoutedEvent
Constructors
Initializes a new instance of the RaisedRoutedEvent class with default values.
public RaisedRoutedEvent()
This parameterless constructor is required for XML serialization and creates an instance with uninitialized properties that must be set separately before the instance can be used for event matching operations.
Initializes a new instance of the RaisedRoutedEvent class with the specified event context information.
public RaisedRoutedEvent(RoutedEvent routedEvent, string sender, EventBehaviorSenderType senderType, RoutingDirection direction)
The RoutedEvent definition that identifies the type of event being raised.
senderstringA string identifier for the event sender, interpreted according to the sender type.
senderTypeEventBehaviorSenderTypeThe EventBehaviorSenderType that determines how the sender parameter should be interpreted.
directionRoutingDirectionThe RoutingDirection indicating whether this is a tunneling or bubbling event.
This constructor creates a complete raised routed event context that can be used for precise event matching in the event behavior system. The parameters work together to create a comprehensive filter that can match events based on multiple criteria:
- The routed event provides the event identity and type information
- The sender and sender type specify which elements should trigger behaviors
- The direction indicates whether to match tunneling or bubbling events
Properties
Gets or sets the routing direction - tunnel or bubble.
public RoutingDirection Direction { get; set; }
Gets or sets a value indicating the routed event.
public RoutedEvent RoutedEvent { get; set; }
Gets or sets the sender's type.
public EventBehaviorSenderType SenderType { get; set; }
Methods
Compares the instance with the other event arguments and the sender of the event.
public bool IsSameEvent(RadElement senderElement, RoutedEventArgs eventArgs)
Compares the instance with another event passed as a parameter.
public bool IsSameEvent(RaisedRoutedEvent targetEvent)