Class
RoutedEventArgs

Represents event arguments for routed events in the Telerik WinControls framework, providing comprehensive information about the event's routing state, direction, and original event data.

Definition

Namespace:Telerik.WinControls

Assembly:Telerik.WinControls.dll

Syntax:

cs-api-definition
public class RoutedEventArgs : EventArgs

Inheritance: objectEventArgsRoutedEventArgs

Derived Classes: ShapeRoutedEventArgs

Inherited Members EventArgs.Empty

Constructors

RoutedEventArgs(EventArgs, RoutedEvent)

Initializes a new instance of the RoutedEventArgs class with the specified original event arguments and routed event definition.

Declaration

cs-api-definition
public RoutedEventArgs(EventArgs args, RoutedEvent routedEvent)

Parameters

args

EventArgs

The original EventArgs from the CLR event that triggered this routed event.

routedEvent

RoutedEvent

The RoutedEvent definition that describes the routed event being processed.

Remarks

This constructor creates a new routed event arguments instance that preserves the original CLR event data while associating it with a specific routed event definition. This design allows the routed event system to maintain full fidelity with the original event information while adding routing capabilities.

The original event arguments are stored and can be accessed through the OriginalEventArgs property, allowing event handlers to access all the original event data as needed. The routed event definition provides metadata about routing behavior, event identity, and handling requirements.

Properties

Canceled

Gets or sets a value indicating whether the routed event processing should be canceled.

Declaration

cs-api-definition
public bool Canceled { get; set; }

Property Value

bool

true if the event processing should be canceled and further routing stopped; otherwise, false. The default value is false.

Remarks

When this property is set to true, the routed event system stops further routing of the event through the element tree. This allows event handlers to prevent the event from reaching other elements, effectively canceling the event processing.

Event cancellation is particularly useful in tunneling (preview) events where parent elements may want to prevent child elements from receiving certain events based on validation, security, or business logic requirements.

Direction

Gets or sets the routing direction for this routed event instance.

Declaration

cs-api-definition
public RoutingDirection Direction { get; set; }

Property Value

RoutingDirection

A RoutingDirection enumeration value indicating whether the event is tunneling or bubbling.

Remarks

This property indicates the current routing direction of the event as it travels through the element tree. The direction affects which elements receive the event and in what order:

  • Tunnel: Event travels from root down to target element
  • Bubble: Event travels from target element up to root

Event handlers can use this information to implement different logic based on whether they are receiving the event during the preview (tunnel) phase or the main (bubble) phase of event processing.

OriginalEventArgs

Gets or sets the original event arguments from the CLR event that triggered this routed event.

Declaration

cs-api-definition
public EventArgs OriginalEventArgs { get; set; }

Property Value

EventArgs

An EventArgs instance containing the original event data, or Empty if no original event data is available.

Remarks

This property preserves the complete original event information from the underlying CLR event that initiated the routed event processing. This allows event handlers to access all the original event data, including specialized event argument types with additional properties specific to the original event.

For example, if a routed event was triggered by a mouse click, the original event arguments might contain mouse coordinates, button information, and other mouse-specific data that remains accessible through this property even after the event has been wrapped in the routed event system.

RoutedEvent

Gets or sets the routed event definition associated with this event arguments instance.

Declaration

cs-api-definition
public RoutedEvent RoutedEvent { get; set; }

Property Value

RoutedEvent

A RoutedEvent instance that defines the identity, routing behavior, and handling requirements for this event.

Remarks

This property provides access to the routed event definition that describes how this event should be routed through the element tree. The routed event definition contains metadata such as the event name, routing strategy, owner type, and handler type requirements.

Event handlers can use this property to determine the specific routed event being processed and access its metadata for advanced event handling scenarios, such as conditional processing based on event identity or routing behavior.