ClassEventManager
Provides event-related utility methods that register routed events for class owners and add class handlers.
Definition
Namespace:Telerik.UI.Xaml
Assembly:Telerik.WinUI.Controls.dll
Syntax:
public static class EventManager
Inheritance: objectEventManager
Methods
RegisterClassHandler(Type, RoutedEvent, Delegate)
Registers a class handler for a particular routed event.
Declaration
public static void RegisterClassHandler(Type classType, RoutedEvent routedEvent, Delegate handler)
Parameters
classType
routedEvent
handler
RegisterClassHandler(Type, RoutedEvent, Delegate, bool)
Registers a class handler for a particular routed event, with the option to handle events where event data is already marked handled.
Declaration
public static void RegisterClassHandler(Type classType, RoutedEvent routedEvent, Delegate handler, bool handledEventsToo)
Parameters
classType
The type of the class that is declaring class handling.
routedEvent
The routed event identifier of the event to handle.
handler
A reference to the class handler implementation.
handledEventsToo
True to invoke this class handler even if arguments of the routed event have been marked as handled; false to retain the default behavior of not invoking the handler on any marked-handled event.
RegisterRoutedEvent(string, RoutingStrategy, Type, Type)
Registers a new routed event with the event system.
Declaration
public static RoutedEvent RegisterRoutedEvent(string name, RoutingStrategy routingStrategy, Type handlerType, Type ownerType)
Parameters
name
The name of the routed event. The name must be unique within the owner type and cannot be null (Nothing in Visual Basic) or an empty string.
routingStrategy
The routing strategy of the event as a value of the enumeration.
handlerType
The type of the event handler. This must be a delegate type and cannot be null (Nothing in Visual Basic).
ownerType
The owner class type of the routed event. This cannot be null (Nothing in Visual Basic).
Returns
The identifier for the newly registered routed event. This identifier object can now be stored as a static field in a class and then used as a parameter for methods that attach handlers to the event. The routed event identifier is also used for other event system APIs.