EventManager.RegisterRoutedEvent Method (String, RoutingStrategy, Type, Type)
Registers a new routed event with the Windows Presentation Foundation (WPF) event system.
Assembly: PresentationCore (in PresentationCore.dll)
static member RegisterRoutedEvent : name:string * routingStrategy:RoutingStrategy * handlerType:Type * ownerType:Type -> RoutedEvent
The name of the routed event. The name must be unique within the owner type and cannot be null or an empty string.
The routing strategy of the event as a value of the enumeration.
The type of the event handler. This must be a delegate type and cannot be null.
The owner class type of the routed event. This cannot be null.
Return ValueType: System.Windows.RoutedEvent
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.
Use the return value of this method to create the static declaration for a unique RoutedEvent identifier field. This field should be stored within the owner type.
There are a considerable number of conventions and best practices associated with how routed events should be named, registered, and exposed in a class. For more information, see Routed Events Overview.
Available since 3.0