public static readonly RoutedEvent MyCustomEvent = EventManager.RegisterRoutedEvent("MyCustomEvent", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MyControl)); public event RoutedEventHandler MyCustomEventHandler { add { AddHandler(MyCustomEvent, value); } remove { RemoveHandler(MyCustomEvent, value); } }In this example, we define a new custom event called MyCustomEvent that can be routed through the visual tree using the Bubble routing strategy. This event can be handled by any element of type MyControl, and a RoutedEventHandler delegate is used to handle the event.