ContentElement.AddToEventRoute(EventRoute, RoutedEventArgs) ContentElement.AddToEventRoute(EventRoute, RoutedEventArgs) ContentElement.AddToEventRoute(EventRoute, RoutedEventArgs) ContentElement.AddToEventRoute(EventRoute, RoutedEventArgs) Method

定義

針對目前的 EventRoute 事件處理常式集合,將處理常式加入至指定的 ContentElementAdds handlers to the specified EventRoute for the current ContentElement event handler collection.

public:
 void AddToEventRoute(System::Windows::EventRoute ^ route, System::Windows::RoutedEventArgs ^ e);
public void AddToEventRoute (System.Windows.EventRoute route, System.Windows.RoutedEventArgs e);
member this.AddToEventRoute : System.Windows.EventRoute * System.Windows.RoutedEventArgs -> unit
Public Sub AddToEventRoute (route As EventRoute, e As RoutedEventArgs)

參數

route
EventRoute EventRoute EventRoute EventRoute

加入處理常式的事件路由。The event route that handlers are added to.

e
RoutedEventArgs RoutedEventArgs RoutedEventArgs RoutedEventArgs

用於加入處理常式的事件資料。The event data that is used to add the handlers. 這個方法會使用引數的 RoutedEvent 屬性來建立處理常式。This method uses the RoutedEvent property of the arguments to create the handlers.

備註

將此方法用於內容主項目目 (不論是否執行IContentHost), 以便將內容主機子專案的處理常式新增至主機。 EventRouteUse this method for content host elements (regardless whether they implement IContentHost) in order to add handlers for the content host child elements to the host EventRoute.

適用於